T
T
Test Test2015-03-12 10:36:09
git
Test Test, 2015-03-12 10:36:09

How to overwrite a commit on bitbucket?

Good morning! The question is: how to overwrite an existing commit on bitbucket?
For example, I made a commit and uploaded the changes to the repository.

git add .
git commit -m "My commit"
git push origin

After deciding that the commit is incomplete, adding changes, I make another commit with the --ammend tag
git add .
git commit --amend -m "My commit"
git push origin

But the new changes are not sent to the server. If you check the logs, it turns out that the changes were successful in the local repository, and the hash of the commit has changed, but the changes cannot be downloaded to the repository in bitbucket.
What do you advise?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
V
Victor, 2015-03-12
@cubooks

git push with the --force option if no one else has downloaded that old commit and pushed to the server after you.
Or you can pull, then push, but then there will be two almost identical commits on Bitbucket.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question