在開發我有2個分支機構Git的開關文件:不能推
$ git branch
dev *
master
我已經從開發做
$ git checkout master
$ git checkout dev <file path>
當我複製文件到主分支試圖提交該文件
[email protected]:~/abc.sg/magento# git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
然後
[email protected]:~/abc.sg/magento# git push
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use:
git config --global push.default matching
To squelch this message and adopt the new behavior now, use:
git config --global push.default simple
When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name.
Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch.
See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
Permission denied (publickey,keyboard-interactive).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
當我運行日誌,看看那麼說
* 4b471cd - (10 minutes ago) WIP on master: b937e71 Text - Text (refs/stash)
我以root身份登錄
請仔細閱讀git輸出,特別是以Permission denied開頭的最後兩段落 – AlexD
是的,但是我以root身份登錄@AlexD –
您需要確保您的本地用戶root可以訪問您嘗試推送的遠程存儲庫至 – AlexD