Z
Z
ZaurK2016-10-20 14:16:59
git
ZaurK, 2016-10-20 14:16:59

How to add changes to an already made commit in git?

Hello! There was such a question. In git I have two branches master and testing, being in the testing branch I make some changes and then fix it in commit, but then I remember that I forgot to change something and I add new changes with the git add * command and in order not to produce a new one commit , I write the command git commit --amend and my changes are safely added to the last commit. But when I try to switch to the master branch, git does not let me in and requires me to commit the latest changes ... Why and how to do this right? like it says in the book.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Saboteur, 2016-10-20
@ZaurK

git add
git commit --amend
is enough.
But try git status to see what's wrong - maybe not all files were added via git add

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question