The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

.gitignore

Navid Vaziri
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!
February 6, 2019

I have two branches that one has specific file which I don't want to go to destination branch during the merge. I put the path of the file in .gitignore file of destination branch, but during the merge, the file came to it.

Whether Bitbucket look at .gitignore during the merge or not?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Tyler T
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 7, 2019

Hi Navid, this problem isn't specific to Bitbucket but rather how Git works. Since the file is already being tracked by Git, you would need to update the .gitignore and run the following command:

git rm --cached <file>

Warning: If you are working on a team, this will remove the file from your teammates computers when they run `git pull`

There is a lot of discussion about this issue over at Stack Overflow: https://stackoverflow.com/a/1274447

Legal Navid
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!
February 7, 2019

@Tyler T I think you did not get my question. This is not related to any local computer. This is totally in bitbucket as remote repository. One branch which is merge to destination branch has a file that is in list of gitignore in destination branch. Is destination branch at bitbucket look at gitignore when merge is happened?  If yes why the file was copy to it?

TAGS
AUG Leaders

Atlassian Community Events