git pull 每次都要求输入用户名和密码
git config --global credential.helper store
git config credential.helper store
git config --list
设置用户名和邮箱
git config --global user.name "Your Name"
git config --global user.email "your@email"
git pull 发生文件冲突
error: Your local changes to the following files would be overwritten by merge:
public/file/xxx.docx
Please, commit your changes or stash them before you can merge.
Aborting
git reset --hard
git pull
配置ssh秘钥
cat ~/.ssh/id_rsa.pub
ssh-keygen -t rsa -C "<邮箱>"
Windows:
clip < ~/.ssh/id_rsa.pub
Mac:
pbcopy < ~/.ssh/id_rsa.pub
GNU/Linux (requires xclip):
xclip -sel clip < ~/.ssh/id_rsa.pub
已有文件夹或者仓库
cd file
git init
git remote add origin xxx.git
git add .
git commit
git push -u origin master
去除版本控制
git rm -r -n --cached ".vs/"
git rm -r --cached ".vs/"
git commit -m "message"
git push origin master
|