Reputation: 58
I checked out to a previous commit in my master branch. Then did some changes and made a commit there itself. Now I wish to push the changes to master branch. But it says everything up-to-date.
In short I did this,
git checkout 573789f3
(a previous commit in master branch)
Made some changes there and commited them there itself.
git add .
git commit -m "message"
Now when I do git push origin master
, I get Everything up-to-date
Also, I want this commit to be the HEAD of the master branch
Upvotes: 0
Views: 41
Reputation: 3549
The problem is that once you checkout a commit, you are no longer on master
. So when you push master
it's up to date because it's unchanged!
Am I right that you want to remove the latest commit, and add a commit of your own. I would suggest you do it like
git checkout master # if you didn't do it already
git reset --hard 573789f3 # Or HEAD~
<do your changes>
git commit -am 'message'
git push --force # The --force will be necessary as you are obliterating the previous HEAD commit
Upvotes: 2