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 Join to answer
Community showcase
Piotr Plewa
Published Dec 27, 2017 in Bitbucket

Recipe: Deploying AWS Lambda functions with Bitbucket Pipelines

Bitbucket Pipelines helps me manage and automate a number of serverless deployments to AWS Lambda and this is how I do it. I'm building Node.js Lambda functions using node-lambda&nbsp...

681 views 0 4
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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot