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?
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
@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?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.