参考
https://backlog.com/git-tutorial/cn/intro/intro1_1.html
https://www.liaoxuefeng.com/wiki/896043488029600
常用
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
|
新增功能
1 2 3 4 5 6 7 8 9 10 11
| git checkout -b branch_name
git add .
git commit -m "fix(price_manage):修正 price_manage 目录下的"
git push origin branch_name
|
dev 合共 feature 分支
1 2 3 4 5 6
| git checkout dev git pull
git merge branch_name git push
|
修复 BUG
删除分支
1 2 3 4 5
| git branch -d new_store
git push origin --delete new_store
|
修改用户信息
1 2 3 4 5 6 7 8 9
| git config --global user.name huanglanying
git config --global user.email huanglanying@hitour.cc
git config user.name git config user.email
|
工作栈
1 2 3 4 5 6 7 8 9 10 11
| git stash
git stash pop
git stash list
git stash apply stash@{0}
|
合并
版本回退
查看远程与本地分支对应关系
git remote show origin
再运行一次 git branch -a 就能看到变化了
刷新远程分支(有的远程分支已删除但本地仍显示)
git remote prune origin
1 2 3 4 5 6 7
| lanying@lanyingdeMacBook-Pro some-project % git remote prune origin Pruning origin URL: git@xxx/some-project.git * [pruned] origin/dev * [pruned] origin/feat-0910 * [pruned] origin/test lanying@lanyingdeMacBook-Pro some-project %
|
查看 git config
1 2 3
| git config --global --list
vim ~/.gitconfig
|