目录

Git基础命令

目录
1
git init
1
git add filename
1
2
3
git add .

git add --all
1
git rm filename
1
git commit -m "提交的说明"

commit可以一次提交缓冲区的所有文件

1
git status -b
1
git diff filename
1
git log
1
git reset
1
git reset --hard HEAD^
1
git reset --hard d7b5
1
git reflog
1
git branch
1
git branch "分支名"
1
git checkout "分支名"
1
git checkout -b "分支名"
1
git merge "分支名"
1
git branch -d "分支名"
1
git log --graph
1
git tag "标签名" "版本号"
1
git tag
1
git show "标签名"
1
git push origin --tags
1
git push origin v1.0
1
git remote add origin git://127.0.0.1/abc.git 
1
git remote remove origin
1
git push -u origin master
1
git pull

tips:如果push的时候,本地和文件和远端文件有冲突,就要先pull、然后手动解决冲突,才能继续push

1
2
[credential]
  helper = store
1
git push -f origin master
0  字
评论
Powered by Waline v1.6.0