I'm pretty new to Git (used to work with SVN) so I might be using it the wrong way but here is the issue:
Problem is, I can't figure out how to ignore specific files for a branch but not another!
Ex: I have added a new plugin in the Plugins/Android folder in the Android branch. But I also have fixed some nasty issue in the common part. I want to push and merge to the clean branch so when iOS workers will pull from the clean branch they will have the fix but not the plugin. Android workers need to have the plugin thought. I would like the Plugins/Android folder to be ignored (not pushed) when I will merge toward the clean branch, but actually pushed when I'll push toward the Android remote branch.
From my search, solutions are either to manually remove files on the clean branch after pushing (waste of time and prone to mistakes) or use a .gitignore. But a .gitignore seems to work across the whole repository so my platform-branches will ignore them too.
Am I missing something ? Please enlighten me on this !
The .gitignore file being tracked like any other is precisely what allows it to be different in different branches. Whenever you check out a branch, the .gitignore will be replaced by the one in that branch and the right version will be used when committing changes. 1.: You create a .gitignore in your working folder and commit it to the branch you have currently checked out. 2.: You switch to another branch. (The .gitignore file will be gone from your working folder.) 3/a.: You create a new, different .gitignore in your working folder and commit it to the branch you have currently checked out. OR 3/b.: Cherry-pick the commit from step 1, make changes to the .gitignore and commit them. 4.: Repeat 2 and 3 as desired for other branches. If you create branches after this is done, the new branch will, at the beginning, have the same .gitignore as the parent branch, but you can make edits and commit them, as needed.
You might have more luck attempting to use subtrees or submodules (I've never used either, so I may be way off). You're going to find that .gitignore won't just prevent those files from being pushed to your core branch, it will also prevent them from being committed to your platform branch.
You might have more luck finding a Unity developer forum and asking for advice about how similar developers handle versioning of platform-specific code.
Announced in this blog, this holiday season we’re celebrating all things CI/CD and between now and the end of 2019 we’ll be showcasing content, use cases, feature announcements and more. One featur...
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