git fetch origin && git reset –hard origin/master
git branch -a
git branch -r
git push origin master -f
git revert -m 1 xxxx
git rebase –interactive ID^ 將須要修改的記錄的 pick 改爲 edit 執行更改 git commit –all –amend git rebase –continue
Host bitbucket.org HostName bitbucket.org PreferredAuthentications publickey IdentityFile ~/.ssh/id_rsa User git Host bitbucket.org-key2 HostName bitbucket.org IdentityFile ~/.ssh/key2_id_rsa User git
[remote 「origin」] url = git@bitbucket.org-key2:XXXX/yyyy.git fetch = +refs/heads/*:refs/remotes/origin/*
git remote rename origin upstream
git remote add origin URL_TO_GITHUB_REPO
git push origin master
git pull upstream master && git push origin master
git reset –soft HEAD~1