git远程仓库包含未提交到本地分支的提交 [英] git remote repository contains commits unmerged into the local branch
问题描述
我在netbeans IDE中使用git。我想改变最近提交的提交信息。我这样做,检查修改上次提交
复选框并将其提交到我的本地存储库。当我将这个提交推送到我的github仓库时,出现错误: git远程仓库包含未提交到本地分支的提交。打开输出以查看更多信息。
如何解决此问题?我是新来源控制。我只想用我当前的项目进行非常基本的版本控制。请告诉我如何解决此问题。
屏幕:
输出消息:>
git branch
git remote -v
设置remote:origin
git子模块状态
git push https://github.com/double-whammy/netbeans_affablebean.git refs / heads / master:refs / heads / master
远程仓库更新
分支更新:master
旧版Id:id1
新版Id:id2
结果:REJECTED_NONFASTFORWARD
本地版本库更新
分支更新:origin / master
旧版id:id1
新建Id:id2
结果:NOT_ATTEMPTED
== [IDE] ==推送 - AffableBean完成。
我再次阅读错误消息,并认为我应该将本地分支合并到远程分支中。我在IDE中查找以找到这些选项。当我尝试时我很幸运:
项目>右键点击> Git>资源库浏览器
。
打开以下窗口:
步骤:
-
远程分支>右键>合并修订。然后你会看到本地的远程哈希。
-
项目>右键单击> 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.
Screen:
Output message:
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.
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
.
The following window opens up:
Steps:
Remote branch > right click > merge revision. Then you will see the hash of remote next to local.
Project > Right click > Git > Remote > Push. This will push your local branch code to remote repo.
这篇关于git远程仓库包含未提交到本地分支的提交的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!