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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值