$git branch -m OLD_NAME NEW_NAME
上傳新名稱 branch 到遠端
$git push origin NEW_NAME:NEW_NAME
刪除遠端的舊名稱 branch
$git push origin --delete OLD_NAME
$git branch -m OLD_NAME NEW_NAME
$git push origin NEW_NAME:NEW_NAME
$git push origin --delete OLD_NAME
$git clone https://github.com/username/repo-name.git進入 repository 目錄
$cd repo-name增加遠端 repository
$git remote add gitlab https://gitlab.com/username/repo-name.git上傳 commit
$git push -f --tags refs/heads/*:refs/heads/*
:retab
:1,$s/hello/hi/g將字串 hello 換成 hi。1,$表示從頭到尾。
$git rebase -i HEAD~2如果要還原到前三個版本
$git rebase -i HEAD~4
$git push origin +master
git clone -b BRANCH_NAME REMOTE_GIT_REPO_URL
git clone REMOTE_GIT_REPO_URL -b BRANCH_NAME DIR
git checkout -b BRANCH_NAME
git push origin BRANCH_NAME
git clone --recursive REMOTE_GIT_REPO_URL
git submodule add REMOTE_GIT_REPO_URL SUBMODULE_NAME
git submodule add -b BRANCH_NAME REMOTE_GIT_REPO_URL SUBMODULE_NAME
git rm SUBMODULE_NAME
rm -R SUBMODULE_DIR
git checkout BRANCH_NAME
git add -A .
git commit -m "UPDATE_MESSAGE"
git push origin BRANCH_NAME
git submodule