我做了一個叫1.3
從主分支,然後混帳:幫助檢索當地的PyCharm承諾,WebStorm
$ git checkout 1.3
$ git branch --set-upstream-to=origin/1.3
$ git push -u origin/1.3
編輯:我做了,如果說有什麼區別的上述3個步驟之前git push -u origin master
?
但不知何故,我失去了最後一次本地提交,這意味着我甚至無法推送到Bitbucket?
如何檢索最後一次提交?爲什麼它沿着痕跡丟失或消失?
生成ssh-key作爲personalid後。
這是我的〜/ .ssh/config中
Host bitbucket.org
IdentityFile ~/.ssh/id_rsa
#Default GitHub user
Host github.com
HostName github.com
PreferredAuthentications publickey
IdentityFile ~/.ssh/b
# Work user account
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/workid
Host bitbucket.org
HostName bitbucket.org
PreferredAuthentications publickey
IdentityFile ~/.ssh/personalid
這是'git checkout 1.3'或'git checkout -b 1.3'嗎? – forevergenin
嗨forevergenin:git checkout 1.3同上 – niceseb
'git checkout 1.3'不會創建一個新的分支。它只會檢出一個已經創建的分支。在你的情況下,它看起來像已經有一個名爲'1.3'的分支,它已經檢出。如果你想從當前簽出的分支創建一個新的分支,你必須運行'git checkout -b 1.3'。 – forevergenin