Amending git commits
During the past few years of using git, I’ve come across several commands which have become pivotal in my workflow. One of them is git commit --amend
.
Amending a commit
How many times have you inadvertently forgotten to include a file in your last commit? I know my Github can attest to my forgetfulness. We will first start out by creating a file named help.md
It seems we forgot to include some text in the help file. To fix it we will append the information to the end of the file using the echo
command.
You can now add it back to the list of tracked files and amend your commit using the following
Congratulations, you have successfully amended a commit!
References
No comments yet. Share on Mastodon and see your comment or write a post on your blog if you support Webmentions
No reposts yet. Share on Mastodon and see your repost or write a post on your blog if you support Webmentions
No likes yet. Share on Mastodon and see your like or write a post on your blog if you support Webmentions
No bookmarks yet. Share on Mastodon and see your bookmark or write a post on your blog if you support Webmentions
Powered by Webmentions