It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to Solve conflict file in git with same edit file with different commit?

Sory I'm newbie in using git.. I have small working team to manage my code with git. I have 4 members team include with me. And the question that I want to ask..

Suppose I have created file called file.txt and then I have added one line with my commit to the master branch with the default text

"-----Text--------" 

And then 3 members others called MrA, MrB and MrC. Supposed it happends today with different file commit time.

MrA have been cloned the source and edited his work like this.

"-----Text--------" Line added by MrA; 

And MrA commits to the remote repository in the server..

But at the same time MrB also have modified with the file.txt like this

"-----Text--------" Line added by MrB; 

When MrA commit there's no problem since there's no body change before. Bur when MrB want to commit it has message error and get the conflict. And then MrB trying to pull has error also with the message you have to move file.txt or stash it to merge the content.

How can I suppose to do? I'm still newbie in Git. Thanks

1 answer

This may be way too late, but it sounds like MrB is trying to commit and push at the same time. He should be able to commit to his local repository without any error, then merge the older commit by MrA from the remote server (would happen with a pull), then push the merged code.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Agile

Webinar: Dean Leffingwell and Steve Elliot present on SAFe 5.0, come ask Dean and Steve questions!

...steemed Steve Elliot (head of product for Jira Align). Agenda: What’s new or changed in SAFe 5.0: Introduction of OKRs Essential SAFe How to achieve true business a...

151 views 0 1
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you