git commit issue

We have migrated from svn to git lately. And I am not good with git till now. My problem is that, I have committed some files and it cause to lose the file changes others did. But the changes are there in my instance but not in any others(they  lost what they committed). The graph shows the details. The top two commits I have marked caused the issue. Please help me to resolve the issue. I am not using commands for git, but tortoise git UI.

 

git.png

1 answer

When you push your changes to the remote (probably "origin"), do NOT "force" push. If your push fails, that usually means you need to merge changes that others have pushed to origin with your own changes (that merge must be done locally). After the merge, you should be able to succeed at pushing (still no "force").

Please keep in mind that git is fundamentally different from SVN, and even the most basic operations work very differently. Please read the Git book (Sections 1.1 - 1.3 and Chapters 2 and 3) before doing anything else in git.

Thank you for the reply. Is there any way to resolve this? will rebase help to resolve the issue?

You (or your teammates) will probably need to go to the command line to retrieve the lost commits. Search google and stackoverflow for your issue, and keep an eye out for references to "git reflog".

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

426 views 6 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you