question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unable to push to empty repository on GitHub

See original GitHub issue

First of all: thanks for this wonderful library. It seems to be exactly what I need.

I am experimenting with this a bit (Firefox 57) and I can’t get a simple clone-edit-commit-push cycle to work. What am I doing wrong. In the <head> of my html I have included isomorphic-git and browserfs as instructed. In the body I have a script tag containing:

git('.').clone('https://cors-buster-jfpactjnem.now.sh/github.com/wDhTIG/rthKRF');
fs.writeFile('README.md', 'Test', 'utf8', (err) => {
    if (err) throw err;
        console.log('The file has been saved!');
});
git('.').auth('mysecret')
        .add('README.md')
        .commit('Test commit')
        .push('master');

I get the following errors in the console log:

The character encoding of the HTML document was not declared. The document will render with garbled text in some browser configurations if the document contains characters from outside the US-ASCII range. The character encoding of the page must be declared in the document or in the transfer protocol. git.html Unhandled promise rejection TypeError: l(…) is undefined Stack trace: e/<@https://unpkg.com/isomorphic-git:1:80863 n@https://unpkg.com/isomorphic-git:1:125272 f/<@https://unpkg.com/isomorphic-git:1:126316 o/</e[t]@https://unpkg.com/isomorphic-git:1:125448 i@https://unpkg.com/isomorphic-git:1:120912 i/<@https://unpkg.com/isomorphic-git:1:121012 B/</<@https://unpkg.com/isomorphic-git:1:273404 B/<@https://unpkg.com/isomorphic-git:1:273274 f@https://unpkg.com/isomorphic-git:1:257078 isomorphic-git:1:273747 Source map error: request failed with status 404 Resource URL: https://unpkg.com/isomorphic-git Source Map URL: bundle.umd.min.js.map

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
wDhTIGcommented, Nov 29, 2017

Would it be possible for you to create an example repository on github such that:

  • one can just clone it, and fix two lines in the settings (API key + repository name)
  • have a very basic website running on github pages (for example some buttons that run example queries) And as a bonus, people get to experiment via the console automatically.

This would provide a sort of skeleton upon which I could build further. For example, as a first project, to test whether I get how this works, I would then try to evolve my clone into an online github editor, provide a basic file browser + codemirror frame for editing & writing commit messages.

0reactions
wmhiltoncommented, Jul 21, 2018

I just confirmed I am able to push to an empty repository on Github:

$ isogit push --username=wmhilton --password=$GITHUB_TOKEN --url=https://github.com/wmhilton/empty
>> git.push({fs, dir: '.', "username":"wmhilton","password":"XXXXXXXXXXXXX","url":"https://github.com/wmhilton/empty"})
{
  "ok": [
    "unpack",
    "refs/heads/master"
  ]
}

Also, after adding a remote and creating a new branch, I was able to push that new branch:

$ isogit push --username=wmhilton --password=$GITHUB_TOKEN
>> git.push({fs, dir: '.', "username":"wmhilton","password":"XXXXXXXXXXX"})
{
  "ok": [
    "unpack",
    "refs/heads/newbranch"
  ]
}

Since I’d renamed this issue to “Unable to push to empty repository on GitHub” and that appears to not be a problem anymore, I shall close this issue. But continue to create new issues and to chat in Gitter as you encounter new obstacles!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot push to empty repo in github - Stack Overflow
1. Possible duplicate of Git error when trying to push -- pre-receive hook declined · Probably the large file is still at fault...
Read more >
Error: failed to push some refs to – How to Fix in Git
This error mainly occurs when you attempt to push your local changes to GitHub while the local repository (repo) has not yet been...
Read more >
How to Fix 'failed to push some refs to' Git Errors - Komodor
It occurs when a developer attempts to push committed code to an external git repository. The ability to push code stopped working suddenly, ......
Read more >
Push commits to an additional Git repository - AWS CodeCommit
If you are pushing to a Git repository that requires credentials, make sure you configure those credentials in a credential helper or in...
Read more >
How to git push an existing project to GitHub | TheServerSide
To allow your existing project to synchronize with GitHub, issue a git remote add command to configure a reference from you local Git...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found