Actually I was not sure so, I followed git amend approach everytime. Is it good practice ? If not Why git amend is not good ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, using
git commit --amendis not a good practice “every time”. It merges your current changes with the previous commit’s changes. You’ll wind up with a single massive commit and no commit history what so ever. You should be making lots of small, granular changes so that you can actually track the evolution of features and introduction of bugs.Using
git reset --soft HEAD^is more or less identical in effect: You’re moving the branch pointer to the previous commit but leaving the working directory state unchanged, then making a single large commit with all the changes you’ve introduced.Using either command every time you commit will leave you with a single commit containing your entire project to date. There is absolutely no good reason to do this, and it is the completely wrong way of using version control.