V-Note

a female robot

站点工具


doc:git_参考手册

Git 参考手册

基本操作

仓库管理:

git init

git add --all
git commit -m "something"
git push origin master

git status
git log
git diff

git reset --hard HEAD^
git reset HEAD readme.txt

git rm test.txt
git checkout -- test.txt

分支管理:

git checkout master
git checkout -b dev

git branch
git branch -d dev
git merge dev

git stash
git stash pop

git cherry-pick 4c805e2

标签:

git tag v1.0 f52c633
git show <tagname>
git push origin --tags

git tag -d v0.9
git push origin :refs/tags/v0.9

远程仓库

配置帐号信息:

git config --global user.name "Your Name"
git config --global user.email "email@example.com"

ssh-keygen -t rsa -C "youremail@example.com"

创建:

git remote add origin https://github.com/Gearkey/test.git
git push -u origin master

git clone git@github.com:gearkey/test.git

管理:

git remote
git checkout -b dev origin/dev

git pull
git branch --set-upstream-to=origin/dev dev
doc/git_参考手册.txt · 最后更改: 2019/12/04 14:38 由 vv224