Last updated on 2024-09-28T11:32:59+08:00
强制覆盖本地代码(与 git 远程仓库保持一致)
1 2 3
| git fetch --all git reset --hard origin/master git pull
|
Please move or remove them before you can merge
Git 推送本地分支到远端
远程先开好分支然后拉到本地
1
| git checkout -b =<branch> origin/<branch>
|
本地先开好分支然后推送到远程
1 2
| git checkout -b <branch> git push origin <branch>
|
Git 回滚代码到某个 commit
1 2 3
| git reset --hard HEAD^ git reset --hard HEAD~3 git reset --hard <commit-id> 退到 / 进到指定 <commit-id> 的 hashm
|
Git 常用命令
https://silhouettesforyou.github.io/2022/02/09/fe38b8191226/