Reputation: 483
git push does not push latest commit to remote.
git keeps push outdated commit to remote! Not the commits I locally amended before push.
How can I force git to cleanup and don't remember the stale commits?
Added Information: git 2.1.0
Upvotes: 2
Views: 1562
Reputation: 1324887
git branch
shows detached state
That would explain why pushing a branch to any remote would push an "outdated" commit: the branch still refer to the old commit, while the new amended commit (referenced by HEAD) is detached from any branch.
You can force a branch to reset to the current HEAD
git branch -f master HEAD
That would reset the branch master to the current amended commit.
Then you can create a new Gitlab repo, and git push -u origin master
.
Upvotes: 2