常用git指令
久一没用就忘記😅,在這記錄一下常用git指令,免得以後又忘記……
超常用
- git add .
- git commit -m “message”
- git push origin main
常用
-
git log
-
git log —oneline
-
git init
-
git branch
-
git branch <branch name>
-
git branch -d <branch name>
-
git checkout <branch name>
-
git checkout -b <branch name>
-
git merge <branch name>
-
git rebase <branch name>
其他
-
git commit —amend
-
git reset —hard HEAD~
-
git reset —hard ORIG_HEAD
-
git revert HEAD
-
git rebase -i HEAD~~
-
git tag
-
git tag <tag name>
-
git tag -d <tag name>
-
git cherry-pick <commit id>
-
git remote -v