I am trying to do a git merge through the terminal. I was working on branch fix_stuff
and I need to merge back into develop
. So I do as follows
git checkout develop
git merge --no-ff fix_stuff
Now it takes me to seemingly a text editor -- still within the terminal -- that has the following message
# Please enter a commit message to explain why this merge is necessary,
# especially if it merges an updated upstream into a topic branch.
#
# Lines starting with '#' will be ignored, and an empty message aborts
# the commit.
Sure enough I press i
and then entered my message. Now that I am done with the message, I don't know how to proceed. I tried esc x
then esc q
. Nothing.
I am using Android Studio terminal through Mac El Capitan
To do a merge (locally), git checkout the branch you want to merge INTO. Then type git merge <branch> where <branch> is the branch you want to merge FROM.
The git merge command lets you take the independent lines of development created by git branch and integrate them into a single branch. Note that all of the commands presented below merge into the current branch.
First we run git checkout master to change the active branch back to the master branch. Then we run the command git merge new-branch to merge the new feature into the master branch. Note: git merge merges the specified branch into the currently active branch. So we need to be on the branch that we are merging into.
Because you pressed i
to enter your text, I think that editor is vim. Assuming that you typed in your commit message ok, you have to do
<esc> :w <enter>
to write to the file and
<esc> :q <enter>
to quit. Note: things in <>
denote key presses.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With