Reputation: 141
Goal: only include generated files on specified branches.
Reasons:
So, in current workflow, main branch is dev, there are two deployment branches: stage and prod.
What I would expect to work is adding
build/*
[branch "stage, prod"]
!build/*
to .gitignore or .git/info/excludes would mean that after I run rake build
on dev branch, build/ does not show changed files when run git status
. On stage and prod branches, build/ would show changed files.
However, all the variations I've tried of the above have not worked.
This seems like pretty typical workflow, is there some git magic I'm missing or how do people deal with this situation?
Upvotes: 7
Views: 9276
Reputation: 5001
I found an tuturial what should match your request. Basicly it is not possible to make differnt ignores per branch. One way to "fake" this behavoir is:
Details how to do this cou can find in gitignore per branch - Tuturial
Upvotes: 3
Reputation: 165606
.gitignore
is a file checked into the repository like any other file. Checkout a branch, change .gitignore
to how you want it for that branch, and commit it. That change will only affect that branch.
Upvotes: 9