在执行git psuh
命令时,可以很容易地跳过输入密码。
vim .netrc
machine github.com
login user1
password pass-user1
git推送时跳过输入密码怎么写两个账号的.netrc?
如下所示编写.netrc是没有用的。
vim .netrc
machine github.com
login user1
password pass-user1
login user2
password pass-user2
根据VonC编辑如下.netrc。
machine github.com login user1 password pass-user1
machine github.com login user2 password pass-user2
git推送的奇怪错误。
git push -u origin master -f
remote: Permission to user2/test.git denied to user1.
fatal: unable to access 'https://github.com/user2/test/': The requested URL returned error: 403
git remote -v
origin https://github.com/user2/test (fetch)
origin https://github.com/user2/test (push)
发布于 2018-06-10 08:32:08
1.在.netrc中设置两个帐户。
machine github.com login user1 password pass-user1
machine github.com login user2 password pass-user2
2.添加git推流原点。
git remote add origin https://user2@github.com/user2/arepo.git
不
git remote set-up origin https://user2@github.com/user2/arepo.git
https://stackoverflow.com/questions/50770234
复制相似问题