Closed xu4wang closed 1 year ago
It works but you can't use ".git" in the URL at the end. This is how isomorphic-git works, at least the version I'm using. I probably should handle that case and strip the ".git" suffix.
OK. thanks @jcubic for quick response.
Looks like I got some issue accessing rawgit website. will do some adjustment and try again.
Finally, it's working on my local machine now.
However, some of the git command is not same as I used to use.
For example, I remove one file, and git add .
, I am expecting I can further git commit -mblablah
to commit the deletion.
But git cannot add the changes. It knows I deleted one file, but refuse to add it.
anonymous@gitwebterm:/markgraph [main]$ git log
anonymous@gitwebterm:/markgraph [main]$ git status
On branch main
nothing to commit, working directory clean
anonymous@gitwebterm:/markgraph [main]$ ls
database doc library src test README.cn.md
README.md index.js package-lock.json package.json
anonymous@gitwebterm:/markgraph [main]$ rm README.cn.md
anonymous@gitwebterm:/markgraph [main]$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in the working directory)
deleted: README.cn.md
anonymous@gitwebterm:/markgraph [main]$ git add .
Could not read file "README.cn.md".
anonymous@gitwebterm:/markgraph [main]$ git status
On branch main
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in the working directory)
deleted: README.cn.md
anonymous@gitwebterm:/markgraph [main]$
A lot of things are not implemented and I don't know if I will find time to add them. The project also uses an older version of isomorphic-git the library.
But you should be able to delete the file if you use git rm README.cn.md
.
Yes. I managed to delete it and am trying to push my commit to remote repo.
anonymous@gitwebterm:/markgraph [main]$ git rm README.cn.md
anonymous@gitwebterm:/markgraph [main]$ git status
On branch main
Changes to be committed:
(use "git rm --cached <file>..." to unstage)
deleted: README.cn.md
anonymous@gitwebterm:/markgraph [main]$ git commit -m"delete readme cn"
You need to use git login first
anonymous@gitwebterm:/markgraph [main]$ git login
This will not authenticate to test if login/password are correct,
only save credentials in localStorage (expect password) and use them when push/clone/commit
username: myemail@gmail.com
password: ****
fullname: Austin Wang
email: myemail@gmail.com
myemail@gmail.com@gitwebterm:/markgraph [main]$ git commit -m"delete readme cn"
Aborting commit due to empty commit message.
myemail@gmail.com@gitwebterm:/markgraph [main]$ git commit -m "delete readme cn"
[master ca05c5e] delete readme cn
1 file, 12 deletions(-)
delete mode 100644 README.cn.md
myemail@gmail.com@gitwebterm:/markgraph [main]$ git status
On branch main
myemail@gmail.com@gitwebterm:/markgraph [main]$ git log
myemail@gmail.com@gitwebterm:/markgraph [main]$ git push
To https://github.com/myemail/markgraph
111ab44..ca05c5e main -> main
myemail@gmail.com@gitwebterm:/markgraph [main]$
It looks good. Except when I exam the remote server in GitHub, the repo was not updated..
Seems the push was failed without any error notice.
Figure out the reason
try {
await git_wrapper.push({
dir,
corsProxy: 'https://jcubic.pl/proxy.php?',
ref: branch,
//authUsername: credentials.username,
//authPassword: credentials.password,
emitter
});
} catch(e) {
console.log(e);
}
The exception e was logged actually. We may need to support using an access token when pushing to github.
An access token is supported, I use 2FA and this is the only way to push changes. You need to put a token as a password If I remember correctly.
An access token is supported, I use 2FA and this is the only way to push changes. You need to put a token as a password If I remember correctly.
Yes. True. I use the token for password, the push was successful!
I just did a quick test, but was not able to clone... is it something wrong with CORS?
From the ocnsole log,
The error is related to fetch.