git remote show origin
git clone <远程仓库路径>
git stash
git pull
- 恢复缓存的修改与当前代码合并(解决可能存在的冲突)
git stash pop
git add .
git commit -m 'xxx'
git push <远程主机名> <本地分支名>:<远程分支名>
git push <远程主机名> <本地分支名> // 远程分支名和本地分支名一致
git push origin HEAD:refs/for/<branchName>
git checkout -- <filename>
git checkout .
git reset --soft HEAD^
git reset --soft <commitId>
git reset --hard <commitId>
git push --force
git merge master
git cherry-pick <commitHash> <commitHash> //多个指定记录
git cherry-pick A..B // 从A到B连续的记录,不包含A
git cherry-pick A^..B // 从A到B连续的记录,包含A
git checkout -b <branchName>
git push origin <branchName>:<branchName>
git branch -d <branchName>
git push origin :<branchName>
git push origin --delete <branchName>
git mv -v oldfolder newfolder
- 修改
git push
指向: .git > config
文件
push = refs/heads/*:refs/for/*
