Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Failed patch changed my Git Bash prompt, how do I revert it?

Tags:

git

git-am

I tried to apply a patch using git am <my.patch, but it failed.

Now I'm getting this in Git Bash:

sashoalm@SASHOALM-PC /c/Workspace/MyProject (master|AM 1/1)

My prompt used to show:

sashoalm@SASHOALM-PC /c/Workspace/MyProject (master)

So something has been "left over" from the unsuccessful patch, how do I completely cancel it, and return to the old prompt?

like image 948
sashoalm Avatar asked Mar 28 '14 18:03

sashoalm


People also ask

What happens when you revert a git commit?

When you revert a Git commit, the changes from the targeted commit are removed from your local workspace. A new commit is also created to reflect the new state of your repository. The syntax to revert a Git commit and undo unwanted changes is simple. All developers need to do is issue the git revert command and provide the ID of the commit to undo:

Why can't I apply a patch in Git?

There could be situations where you might run into error saying git failed to apply patch and concerned diff can no longer be applied According to one of the StackOverflow answers this happens because, By default, git will warn about whitespace errors, but will still accept them. If they are hard errors then you must have changed some settings

How to undo changes that happened in a specific commit?

If you want to undo changes that happened in a specific commit, the git revert command is the correct operation to choose. Git fork vs. clone: What's the difference?

How do I edit a commit message in Git?

Edit a commit message Typos happen, but luckily in the case of commit messages, it is very easy to fix them: git commit --amend # start $EDITOR to edit the message git commit --amend -m "New message" # set the new message directly But that’s not all git-amend can do for you.


1 Answers

You can abort the process:

git am --abort
like image 80
Mureinik Avatar answered Oct 13 '22 12:10

Mureinik