I have this particular scenario, which is simple really, but I don’t see (so far) a similar question here.
I’m working in my own branch copied from a remote repo, And I have added my own tasks to a Capistrano Capfile. These tasks will only help Me deploy the app to my own private server, Therefore when it’s time to Merge my branch with origin master, I don’t want the changes in the Capfile to be pushed to the remote master repo, because, obviously, this file should remain intact over there without my personal alterations.
What’s the best practice to deal with this situation?
Thanks in advance!
PS. I guess that what I’m looking for, is a way to ‘Git Ignore‘ files exclusively for a branch. To over simplify things.
I would suggest to branch a now branch (lets name it
Local) off from your current branch (lets name itOriginal).In
Original, you revert the changes you made to the capfile. InLocal, you continue working on your data as usual. Before it comes to remerge into the remote, you mergeLocaltoOriginaland just pushOriginal. If you do not change the local Capfile further, it should be fine, otherwise you have to (again) revert those changes (although that should result in a merge conflict anyways, so you can handle it in the merge directly).