Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
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

Git merge deleting files while merging

I have a master branch with 3 files, and I've created one develop branch from master. Now i deleted one file and made some changes in another file. 

While merging develop branch into master the file I deleted in develop keep deleting in master as well. But i want to keep those files in master, how can I do that?



1 answer

0 votes
Mikael Sandberg Community Leader Jun 26, 2019

Hi @Gopi Kirshna,

What you are describing is the expected result from a merge. If you remove a file in one branch, the merge will remove it in the target branch too. Please have a look at for an option to pick which files gets "merged" into master. 

Suggest an answer

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

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

7,279 views 5 14
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