Git Commits are not updating

Asked

Viewed 190 times

0

I created a repository on Github and so far everything perfect, at first I gave a commit just for testing.

git add -A
git commit -a -m "Original"

And so far perfect. First Commit

So I made several changes to the code and decided to give one more commit, to save these changes, so again I gave:

git add -A
git commit -a -m "----Qualquer coisa que eu tenha escrito aqui----"

But when I returned to my Github repository, nothing has changed, only the two commits, Original and Initial Commit, have I done something wrong? What remains to be done?

  • 1

    You used the push after committing ? Maybe you forgot.

  • Yes, I gave git push origin master and gives me the message "Everything up-to-date" I tried now to give another commit, gives me the message "Nothing to commit, work Tree clean", probably because I performed the commit of the question and has nothing else to send. What do I do?

  • You can post the output of the following commands: git status and git remote -v

1 answer

0

I managed to find the problem, It happened because I checked out a commit.

However, as I did some commit in HEAD my commits got on a separate branch. They won’t show up in master. The solution for was to create a branch that points to the last of these commits and then merge with master. The command sequence would be:

  1. git checkout -b outra-branch (creating a new branch that points to the commit that HEAD is pointing to)

  2. git checkout master (returning to the master branch)

  3. git merge --no-ff outra-branch (bringing the changes from the other branch to the master)

  4. git branch -d outra-branch (if the branch is no longer needed, it can be removed)

    That solved my problem, I hope I can help someone.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.