Skip to content

Files

Latest commit

 

History

History

Git

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 

查看用户

git config user.name
git config user.email

设置用户

git config --global user.name "username"

git config --global user.email "email"

useradd userName

passwd userName

ssh-keygen

mkdir ~/.ssh && touch ~/.ssh/authorized_keys

cat .ssh/id_rsa.pub | ssh user@123.45.6.78 "cat >> ~/.ssh/authorized_keys"

git init --bare sample.git

错误处理

git pull origin master --allow-unrelated-histories

clone Github过慢

git config --global http.postBuffer 524288000 git config --global http.proxy 127.0.0.1:1080 SS本地代理 git config --global http.proxy 127.0.0.1:1080 SS本地代理

检出分支

git checkout -b 本地分支名 origin/远程分支名

提交本地分支

git push origin 本地分支名:远程分支名

添加标签

git tag -a 标签名 -m '标签说明'

提交本地标签

git push origin 标签名

删除远程分支

git push origin --delete test-feat

删除本地分支

git branch -d test-feat

提交到新分支

git push -u origin new_branch

删除远程旧分支

git push origin :old_branch

重命名分支

  • git branch -m oldBranchName newBranchName
  • git push --delete origin oldBranchName
  • git push origin newBranchName
  • git branch --set-upstream-to origin/newBranchName