I’m really not a git expert. usually I only use -“git add -A” then “git commit -m”msg”” then “git push” and this way everything works just fine.
This time for change, another use made a commit to my project, and after that I also played with “git checkout ” with a SHA1 of an older or newer commit, I don’t even remember.
Since then, I already forked(successfully) the other user commit, and now I just want to commit my folder as it is, and continue to work as normal. The problem is, that now I get –
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
I don’t want to merge anything, I just want to commit&push my current folder in my local computer, just as it is locally, to bitbucket, and then continue using it as normal.
I will study git deeply in the future, I don’t have time now (much work…) – please help.
Thanks a lot.
Well that’s kinda counter intuitive as Git is made to work with partners, so normally, if another devs pushed on your branch, you merge it, and then you push.
If you don’t want to work together, then each made your own repo, or at least made your own branch.
Still, to answer your question, you can write
git push --forceto push your local repo as it is. But carefull, this will overwridde the other developer changes and they’ll be lost*.* You can’t really loose anything that’s committed with Git, but retrieving it after will take some efforts. As Jonas noted in the comments, unreferenced commit will be automatically deleted after some time, so you only have a limited amount of time (30 days) to get it back if this is an error.