How can more changes be added to the latest commit in a repo without making another commit? I need to update the last commit with the newest set of changes that were made after that commit was made.
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.
git commit --amendThis will add your currently staged changes to the previous commit.
If you have pushed your previous commit to a shared repository, such as GitHub, you may want to think twice about doing this however.
If anyone else has pulled down your changes, amending the commit may create merge difficulties for them. In this case it is just better to create a new commit to fix the problem.
If you haven’t yet pushed the bad commit, or if you are working in a private repository and not pushing/pulling changes to/from anyone else, you don’t need to worry about this.