Thats exactly situation --amend option is built for. It is for getting new commit to be merged into previous one so in git history you will see only one entry (the last one)...
For example:
Lets say you notice that you have some extra file inside your project, that shouldn't be there, you can remove it and commit with following command:
git commit -m "removing extra files"
Lets see that commit registered in git history:
Now lets say, after have second look on your project you notice one more extra file and you need to commit again:
This time you can use amend
git commit -m "remove extra zip file" --amend
Now you can see that in history remain only one entry with latest commit message.
No comments:
Post a Comment