Open clonn opened 9 years ago
清除 git remote branch history
git remote prune origin
or
git fetch origin --prune
git push (-u) origin [local_source_branch]:[remote_destination_branch]
git pull (-u) origin [remote_source_branch]:[local_destination_branch]
git fetch (-u) origin [remote_source_branch]:[local_destination_branch]
-u
means setting default upstream, and is the abbreviation of --upstream
.
git push origin :[remote_destination_branch]
Push an empty branch to a remote branch means to delete the remote branch.
git checkout -b [new_branch_name]
git branch -u [remote_branch_to_be_tracked] ([local_branch])
-u
means setting default upstream, and is the abbreviation of --upstream
.
Not specifying [local_branch] means the branch checkout now.
git branch -m ([branch_origin_name]) [branch_new_name]
Not specifying [branch_origin_name] means the branch checkout now.
git branch -D [local_branch]
git log --all --decorate --graph --oneline
git log (--all) --grep="string_to_search"
git commit --amend
git merge [branch_which_merge_to_the_branch_now]
git rebase [branch_which_the_branch_now_rebase_to]
git cherry-pick [commit_1] [commit_2] ... [commit_n]
以下爲常用的小型知識
設定 user
設定 alias