1

I have master branch let's say m and feature branch f. After some commits in feature branch now I want to rebase mater branch into my feature branch. Following is the sequence of the commands I followed

  1. git checkout m
  2. git pull
  3. git checkout f
  4. git rebase m Now I got conflicts in one file which I resolved manually and then fired command
  5. git add <conflicted_file>
  6. git rebase --continue

After firing this command it shows error as COMMIT_EDITMSG.swp already exists! I am not able to understand what action should I take for .swp file. Editor shows different options like Q for quit, E for edit anyway, A for abort, R for recover Can anyone explain which action I should take?

user2664054
  • 541
  • 1
  • 5
  • 9
  • 1
    *Git* is not complaining here. *Vim* is complaining. It's still worth figuring out what is going on, but you're looking in the wrong place. – torek Oct 29 '20 at 07:17
  • Git is not complaining but file is used by git. If I quit then whether subsequent actions will perform correctly? – user2664054 Oct 29 '20 at 07:24
  • 1
    https://engineering.purdue.edu/ece264/16au/resources/vim_swap_warnings `but file is used by git` it isn't, it's used by vim. Do you have another `git rebase` editor running? How did you exit the last editor? – KamilCuk Oct 29 '20 at 07:35
  • BTW, concerning your initial sentence: Git doesn't have "master" or "feature" branches, that is just a common convention maintained by people using git. In consequence, git will never behave differently depending on whether it operates on a master or feature branch. – Ulrich Eckhardt Oct 29 '20 at 07:45

1 Answers1

1

If I quit then whether subsequent actions will perform correctly?

I would try to edit anyway.

You should see an error like:

Found a swap file by the name ".git/.COMMIT_EDITMSG.swp"
          owned by: X   dated: Wed Jan 23 16:01:06 2013
         file name: ~X/Sites/mysite/.git/COMMIT_EDITMSG
          modified: no
         user name: X   host name: X-2.local
        process ID: 77109

Check the process ID/owner associated to that file to understand where it is coming from.

And after the rebase, I would check if .git/.COMMIT_EDITMSG.swp is still there and, if yes, delete it.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250