Git 命令相关
第一次拉取:
git clone
切换远程分支并创建本地分支:
git checkout -b xx origin/xx
删除本地分支:1、切换到其他分支 2、
git branch -D xx
切换本地分支:
git checkout xx
合并分支:
git merge
合并指定:
commit: git cherry-pick
清除所有:
stash:git stash clear
移动Head指向:
git reset
(三种模式:soft mixed hard
)
查看当前分支远程log:
git log remotes/origin/dev
查看前分支Head指向:
cat .git/refs/heads/dev
回到上一次提交:
1、git log
查看上一次提交的编码 如d06770e9c618806b637a8f6ed18936dbb6b080f6
2、git reset
d06770e9c618806b637a8f6ed18936dbb6b080f6(简写至少取前6位 d06770)
拉取步骤:
1、
git stash save
2、
git stash fetch
(有冲突即需要 解决冲突 )
3、
git stash pop/apply
提交步骤:
1、
git add ./
2、
git commit -m 'xxxxx'
3、
git push origin xx
(简写git push)