Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Git merge deleting files while merging

Gopi Kirshna
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 25, 2019

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?

 

Thanks

1 answer

0 votes
Mikael Sandberg
Community Champion
June 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 https://jasonrudolph.com/blog/2009/02/25/git-tip-how-to-merge-specific-files-from-another-branch/ for an option to pick which files gets "merged" into master. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events