I have a branch of my master branch called 218.
I am the only one using this branch.
I commit my changes 3 weeks ago looking to do a pull request, but it was rejected as I needed to make changes.
Now I have made those changes and I wanted to commit the latest changes to my branch.
I tried to commit and it told me I needed to merge and pull. So I did, and it messed up all my files and got rid of my changes I made in the last 3 weeks.
I undid this by: git reset --hard HEAD~1
And now as it stands in my repo on my computer all the files are how they should be. But when I do git status, my changes dont show and it says:
Your branch is behind 'origin/feature/218' by 2 commits, and can be fast forwarded. nothing to commit, working directory clean.
I want to make the branch what I have currently in my repo on my local computer as it stands and not pull anything down but overwrite everything with what I have locally.
How do I do this?
It means your copy of the remote master branch (typically denoted as origin/master) has n commits more than your local version of the master branch. You can resolve this, while you have master checked out, by typing: git merge origin/master.
This means every locally created branch is behind. Before preceding, you have to commit or stash all the changes you made on the branch behind commits. Solution: Checkout your local Master branch git checkout master.
git pull --rebase
I guess this will solve the problem.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With