Skip to content

Instantly share code, notes, and snippets.

@bestlong
Created March 28, 2019 01:52
Show Gist options
  • Save bestlong/d302b209df7f949bcb3fe6ce83dd66b8 to your computer and use it in GitHub Desktop.
Save bestlong/d302b209df7f949bcb3fe6ce83dd66b8 to your computer and use it in GitHub Desktop.
Cheat sheet

git-cheat-sheet

基本操作

git init <目錄>

git clone <repo>

git config user.name <name>

git add <目錄>

git commit -m "message"

git status

git log

git diff

Undo 變更

git revert <commit>

git reset <file>

git clean -n

覆蓋 git 歷史

git commit --amend

git rebash <base>

git reflog

Git 分支

git branch

git checkout -b <branch>

git merge <branch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment