git设置和保存用户名密码

[scott@scott mar_document]$ git clone http://git.idwzx.com:7990/scm/mar_document/document.git
Cloning into 'document'...
Username for 'http://git.idwzx.com:7990': zhangzhiqiang
Password for 'http://[email protected]:7990': 
remote: 对象计数中: 1080, 完成.
remote: 压缩对象中: 100% (897/897), 完成.
remote: Total 1080 (delta 417), reused 511 (delta 177)
Receiving objects: 100% (1080/1080), 65.92 MiB | 6.36 MiB/s, done.
Resolving deltas: 100% (417/417), done.
[scott@scott mar_document]$ git config user.name "zhangzhiqiang"
error: could not lock config file .git/config: No such file or directory
[scott@scott mar_document]$ cd document/
[scott@scott document]$ git config user.name "zhangzhiqiang"
[scott@scott document]$ git config user.email "[email protected]"
[scott@scott document]$ echo "[credential]" >> .git/config
[scott@scott document]$ echo "    helper = store" >> .git/config
[scott@scott document]$ git config --list
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.url=http://git.idwzx.com:7990/scm/mar_document/document.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
user.name=zhangzhiqiang
[email protected]
credential.helper=store

猜你喜欢

转载自blog.csdn.net/i7thtool/article/details/80824596