I have a git branch called 9-sign-in-out
with perfectly working code, and I want to turn it into the master. I'm currently on the master branch.
$ git branch
9-sign-in-out
* master
I'm trying to switch to 9-sign-in-out
branch, but it doesn't allow me to:
$ git checkout 9-sign-in-out
app/helpers/application_helper.rb: needs merge
config/routes.rb: needs merge
error: you need to resolve your current index first
Any idea how can I ignore all the master branch errors and turn the 9-sign-in-out
branch into the master? Maybe git rebase? But I don't want to lose the code in 9-sign-in-out
branch.
This question is related to
git
branch
git-merge
git-branch
git commit -m "Merged master fixed conflict."
as suggested in git status
,
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: a.jl
both modified: b.jl
I used git add
to finish the merging, then git checkout
works fine.
Change branch, discarding all local modifications
git checkout -f 9-sign-in-out
Rename the current branch to master, discarding current master
git branch -M master
I had the same issue when switching from a dev branch to master branch. What I did was commit my changes and switch to the master branch. You might have uncommitted changes.
my issue was (master|REBASE 1/1)
this command worked for me
git rebase --skip
Source: Stackoverflow.com