git 远程存储库包含未合并到本地分支的提交 [英] git remote repository contains commits unmerged into the local branch
问题描述
我在 netbeans IDE 中使用 git.我想更改我最近所做的提交的提交消息.我这样做了,选中了 amend last commit
复选框并将其提交到我的本地存储库.当我将此提交推送到我的 github 存储库时,出现错误:git 远程存储库包含未合并到本地分支的提交.打开输出以查看更多信息.
我该如何解决这个问题?我是源代码管理的新手.我只想对我当前的项目进行非常基本的版本控制.请告诉我如何解决这个问题.
I am using git inside netbeans IDE. I wanted to change the commit message for the most recent commit I had made. I did that, checked the amend last commit
checkbox and committed it to my local repository. When I push this commit to my github repo, I get the error: git remote repository contains commits unmerged into the local branch. open output to see more information.
How do I fix this ? I am new to source control. I only want to do very basic version control with my current project. Please tell me how to fix this.
屏幕:
输出消息:
git branch
git remote -v
setting up remote: origin
git submodule status
git push https://github.com/double-whammy/netbeans_affablebean.git refs/heads/master:refs/heads/master
Remote Repository Updates
Branch Update : master
Old Id : id1
New Id : id2
Result : REJECTED_NONFASTFORWARD
Local Repository Updates
Branch Update : origin/master
Old Id : id1
New Id : id2
Result : NOT_ATTEMPTED
==[IDE]== Pushing - AffableBean finished.
推荐答案
我又看了一遍错误信息,觉得应该把本地分支合并到远程分支.我在 IDE 中环顾四周以找到这些选项.当我尝试时,我很幸运:<代码>项目>右键单击 >git >存储库浏览器.
I read the error message once again and thought that I should merge the local branch into remote branch. I looked around in the IDE to find these options. I got lucky when I tried:
Project > right click > Git > repository browser
.
打开以下窗口:
步骤:
远程分支 > 右键单击 > 合并修订.然后你会在local旁边看到remote的hash.
Remote branch > right click > merge revision. Then you will see the hash of remote next to local.
项目 > 右键单击 > Git > 远程 > 推送.这会将您的本地分支代码推送到远程仓库.
Project > Right click > Git > Remote > Push. This will push your local branch code to remote repo.
这篇关于git 远程存储库包含未合并到本地分支的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!