One late night, in paranoid fear of loosing my progress to hardware failure or something out of the ether, I decided to push master to origin. ![]() So I decided to work locally by amending my last commit every time I wanted to save my progress on the main branch (I know, I should've branched out, committed on that, kept pushing and later merge back to master). Since I had a similar situation, I thought I'd share my situation and how these answers helped me (thanks everyone). How can I fix this issue? The things that I'm looking for is Head of local/master and origin/master point to same commit. Since, I reset the head of origin/master I expect local and origin should be in same direction but as you see, git is saying that my local/master is behind origin/master by 7 commits. ![]() (use "git pull" to update your local branch) Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded. $ git commit -m "Reverting to the state of the project at e3f1e37"įinally, I checkout to my local master. Then I tried to add commit to origin/header that I was not successful. HEAD is now at e3f1e37 development version code incremented for new build. its okay now.Īnd reset the header by this command: $ git reset -hard e3f1e37 If you want to create a new branch to retain commits you create, you mayĭo so (now or later) by using -b with the checkout command again. State without impacting any branches by performing another checkout. You can look around, make experimentalĬhanges and commit them, and you can discard any commits you make in this Since I want to reset origin/header as well, I checkout to origin/master: $ git checkout origin/master ![]() Nothing to commit, working directory clean # (use "git pull" to update your local branch) # Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded. When I enter $ git status command, terminal says: # On branch master I reset my local master to a commit by this command: git reset -hard e3f1e37
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |