2017-06-22 64 views
0

我已經在創建了一個分支在遠程和分支的所有更改本地(git checkout -b gopinath如何提交和推入到位桶

之後,我採取了以下步驟

0)GIT遠程添加上游[您到位桶庫網址在這裏。

1)GIT中的init

2)GIT中狀態

3)GIT中添加。

4)git的承諾-m 「初始提交」

給第4個命令後,我得到這個問題

atal: The current branch gopinath has no upstream branch. To push the current branch and set the remote as upstream, use git push --set-upstream origin gopinath

why i am getting this issue i am doing the wright way to push my code to bitbucket.

,如果我籤的掌握和刪除本地分支我得到這個錯誤味精

Your name and email address were configured automatically based on your username and hostname. Please check that they are accurate. You can suppress this message by setting them explicitly: git config --global user.name "Your Name" git config --global user.email [email protected] After doing this, you may fix the identity used for this commit with:

git commit --amend --reset-author 

8檔改變,6個插入(+),8個缺失( - )`

更新

git branch -a在此之後,我得到*master

git remote -v爲了這個,我得到
upstream https://[email protected]/mobinius/ionicpoc.git (fetch) upstream https://[email protected]/mobinius/ionicpoc.git (push)

git log --graph --all --decorate --oneline我收到這個

* 5c12918 (HEAD -> master) keychain demo * 8b518a4 Initial commit

+0

你是否在git'git remote add origin your_gitrepo_url'中添加了遠程倉庫URL? –

+0

你需要添加遠程倉庫git的遠程添加原點(上游)repo_url –

+0

是的,我補充說,一個@IvanSheigets –

回答

0

您目前還沒有任何本地分支調用任何東西,除了一個叫做master(默認)。

所以首先創建分支:

git branch gopinath 

現在檢查出來(移動到該分支),如果你想

git checkout gopinath 

現在做一些修改和添加它們:

touch newfile 
git add newfile 

現在您可以進行這些更改

git commit -m "added a file called newfile" 

現在,你可以把這些到遠程(即所謂的「上游」)

git push upstream gopinath 

這應該讓你有... 這可能是值得刪除您擁有和重新的遙控器創建他們稱爲「起源」,因爲這是原始回購地點的標準名稱...讓我知道如果您需要這樣做,我會添加命令。

+0

actully我刪除了我的分支,所以只有我沒有顯示,但現在我嘗試並創建了分支,我在提交命令 –

+0

後得到這個問題'您的姓名和電子郵件地址是根據您的用戶名和主機名自動配置的。請檢查它們是否準確。 你可以通過明確地設置它來禁止這條消息: git config --global user.name「Your Name」 git config --global user.email [email protected] 做完這些之後,你可以修改用於這提交: git commit --amend --reset-author' –

+0

沒關係 - 它只是一個警告,但你可以做它建議擺脫它。當它將你的詳細信息添加到使用你的用戶名的提交中時,它說它不知道你是誰。因此,從字面上運行命令'git config --global user.name「你的名字」''和'git config --global user.email you @ example.com',你應該被排序爲將來的提交 –