I have pushed a change in Git with a little mistake. How to add some modification in that same changelist? I heard that it's possible using cherrypick. I'm unable to find how.
Asked
Active
Viewed 127 times
-1
-
1"I'm unable to find how." reading documentation maybe or git book? http://git-scm.com/book – Mateusz Aug 26 '14 at 07:27
-
I tried. But unable to understand. – codedoc Aug 26 '14 at 07:37
-
Maybe start with using git extensions instead of command line. https://code.google.com/p/gitextensions/ – Mateusz Aug 26 '14 at 08:21
1 Answers
0
What you are looking for is probably amend it lets you add your changes to a commit you already made.
The question is have you pushed to a remote or did you just commit? If you only commited ammend is fine but if the commit has been pushed to a remote repository you will have to make a new commit for your changes.
You could push the amended commit to remote but you shouldn't...
-
1
-
I think the user is looking for changing a pushed commit; in this case the amend does not work – sop Aug 26 '14 at 07:28
-
@sop That's why I said if it is already pushed you will have to make a new commit. You don't change pushed commits. – Trudbert Aug 26 '14 at 07:29
-
That's what my question is. I heard that there is an option to do it on the lastly pushed change. Are you sure it's not possible? – codedoc Aug 26 '14 at 07:32
-
You can amend it and push the new commit but that will change the commit history and break it for everyone who already pulled your old commit and did something on that – Trudbert Aug 26 '14 at 07:33
-
1See [how-do-i-push-amended-commit-to-the-remote-git-repo](http://stackoverflow.com/questions/253055/how-do-i-push-amended-commit-to-the-remote-git-repo). It works but is not recommended – Trudbert Aug 26 '14 at 07:35