-
-
Notifications
You must be signed in to change notification settings - Fork 358
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to push to empty repository on GitHub #25
Comments
Aw wow! Thanks and congrats on being (to my knowledge) the first person to try using this library! You are certainly the first issue. Hmm. Your example seems to illustrate some serious oversights in my documentation. I will try to improve that. I think what it needs is more interactive examples. Meanwhile, I'll try to build a jsfiddle for you. |
OK, so there's a bug where the code crashes if you try to push to a completely empty (new) repository on Github, which I'll try to address this week. But here's how your code would look, more or less: BrowserFS.configure({ fs: "InMemory", options: {} }, function (err) {
if (err) return console.log(err);
window.fs = BrowserFS.BFSRequire("fs");
main();
});
async function main () {
await git('.').init();
await git('.').config('remote.origin.url', 'https://cors-buster-jfpactjnem.now.sh/github.com/wmhilton/congenial-waffle');
fs.writeFile('README.md', 'Test', 'utf8', async (err) => {
if (err) throw err;
console.log('The file has been saved!');
await git('.').add('README.md');
await git('.').commit('Test commit');
await git('.').auth('mysecret').remote('origin').push('master'); // Here's where it crashes trying to push to an empty repo
});
} |
Thanks for your reply.
Is there anything I can do to help debugging this issue? |
Would it be possible for you to create an example repository on github such that:
This would provide a sort of skeleton upon which I could build further. |
I did have a very basic website & demo on CodeSandbox and wanted to give you a link after your first post, but when I went to get the link for you I discovered that my demo was broke: https://codesandbox.io/s/mj77r46xkp I think it would be fair to say it's not really ready for people to use. :( My own fault. It's close. It's getting closer! I'll say January will be my 1.0 release that Just Works (TM). However, it sounds like you are interested in building a file browser / code editor / IDE of the future, in which case if you're bold enough I'd love for you to alpha test https://github.com/wmhilton/nde It only works in very recent versions of Chrome and Firefox though. Edit: right now nde is at https://nde.now.sh and has a painfully long installation process with cat gifs, but I'm eventually going to have a "works right away without a long installer experience" at https://wmhilton.github.io/nde |
One of the things I'm going to do, after talking with you and @CMCDragonkai, is to ditch the "fluent" API git("dir").option("value").option("value").command("value") that was supposed to be convenient, but in practice has been var repo = new Git(config);
await repo.command({
option1: "value",
option2: "value",
option3: "value"
}) |
Hmmm, so I have left nde.now.sh running in Firefox 57 for over an hour, and it is still playing cat gifs... |
Oh no it shouldn't take that long. A minute tops. Sounds like you didn't get a progress bar. I mean, if you really want to try it out ASAP you can try closing the cache, unregistering the SW and refreshing... or just give me a few more weeks until I get all the kinks ironed out. :) The wiki graph "mind map" editor sounds really cool, and is exactly the kind of creative project that I was hoping this library would enable! I'll help you get there. I'm limited by my day job to working on the project in the evenings and weekends, but I'm pretty confident that I'll have the new simpler API out by this weekend. |
@wDhTIG I moved the API documentation to https://wmhilton.github.io/isomorphic-git I still need to add examples. But meanwhile you can look at the test cases to get an idea. |
Thanks! This looks great. I will see what I can do with it. I'll keep you updated. |
Just wanted to announce the new Gitter chat room: https://gitter.im/isomorphic-git/Lobby And I am actively working on making an interactive tutorial on Github pages where you'll be able to run |
Status UpdatePretty sure I still need to fix this bug |
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! |
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:I get the following errors in the console log:
The text was updated successfully, but these errors were encountered: