2016-09-29 23 views
-1

我已經創建了當地的分支機構:推動本地分行遠程

git checkout -b tmp1 

現在,我想這個分支推送到服務器:

git push remote_tmp1 tmp1 

遇到錯誤:

fatal: 'remote_tmp1' does not appear to be a git repository 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

如何推動我的分支到服務器?

+1

http://stackoverflow.com/questions/2765421/how-to-push-a-new-local-branch-to-a-remote-git-repository-and-track-it-too –

+0

你應該只有使用您的遠程存儲庫名稱:'git push remote tmp1' –

回答

0

你得到的特定錯誤,因爲你沒有添加remote_tmp1作爲遠程倉庫。

第一添加遠程倉庫,然後重試推: git remote add remote_tmp1 https://remoteserver.com/repository.git git push --set-upstream remote_tmp1 tmp1

您可以添加遠程使用HTTPS如上或者如果可用的ssh。例如,如果你使用的是Github,你可以使用:https://github.com/username/repository.git[email protected]/username/repository.git

0

的混帳推語法是:

git push <remote-name> <branch-name> 

因此,您<remote-name>與遙控器的名稱替換(可能起源如果你從它克隆)。

如果你不知道它的名字,使用git remote

0

這是非常簡單的和他們一樣:

git push origin tmp1 
相關問題