git commit issue

thejas jayaram December 29, 2014

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

1 vote
Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 30, 2014

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.

thejas jayaram December 30, 2014

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

Seth
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 31, 2014

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
TAGS
AUG Leaders

Atlassian Community Events