mauricioSanchez mauricioSanchez - 10 months ago 79
Git Question

Github undoing merge

I don't know what happened but for some reason when I try to use github again I get this error saying that I'm trying to merge something. I completely want to undo the whole thing:

Found a swap file by the name ".git/.MERGE_MSG.swp"
owned by: mauriciosanchezduque dated: Tue May 21 22:18:59 2013
file name: ~mauriciosanchezduque/.git/MERGE_MSG
modified: YES
user name: mauriciosanchezduque host name: Mauricios-MacBook-Pro.local
process ID: 4738
While opening file ".git/MERGE_MSG"
dated: Tue May 21 22:27:11 2013
NEWER than swap file!

I was just trying to pull a new repository and insert some files to start working on it but terminal came up with this message. Any suggestions?

I did a git stash and it seemed to work! But I think I completely messed up github because when I was able to pull the repository I was trying to use it put it on the user folder. So I think git was trying to push all my computer to github. I think at certain point I did a git push -A in the wrong folder and pushed a bunch of folders and files. when I do a git status it shows a bunch of untracked stuff that is in my computer as well as deleted folders. Any idea of how to take it from here? this is what I get:

# Untracked files:
# (use "git add <file>..." to include in what will be committed)
# .Trash/
# .dropbox/
# .openmdao/
# Documents/Arduino/
# Documents/OpenMDAO/
# Documents/gitHub/
# Documents/mySite/
# Documents/openFrameworks/
# Dropbox/
# Library/
# Music/
no changes added to commit (use "git add" and/or "git commit -a")

mvp mvp
Answer Source

To abort screwed up merge, you need to use rather unintuitive

git reset --merge

Most other commands like git rebase, git am use --abort switch for this which is much easier to remember. But, git merge somehow does not support --abort.