I don't know why this seems to be so unclear to me.
I have 2 repos, repo1 and repo2. In each repo are the branches: staging
master
and live
I think part of my problem is that I'm trying to get .gitignore
working after already starting to use git (e.g. the repos were init'd before gitignore was populated correctly).
I've tried all the wonderful git-update-index --assume-unchanged file
's and the neat git rm -r --cached .
's I could find, but I'm still not understanding because it still doesn't work.
I'd like a couple of specific config files and cache folders to be ignored on pull's and push's.
1
If I'm on repo1>staging and I push to repo2>staging, which .gitignore takes precedence? Or do they both get applied?
2
On a couple of attempts, I seemed to have gotten the config files to be ignored on push, but instead of just not sending over the changes to those files, it deleted them entirely out of the branch. Confusing.
3
If it would be smarter to start over (it's an option) in order to get .gitignore working, what would be a smart way to do so so as to not lose all the commits (they don't need to be accessible to the new repos, just accessible for FUBAR sake).
thx
clarifying:
I have existing repos with a few files in them that I no longer want to be transferred on push's or pull's.
.gitignore is either not ignoring, or it is ignoring by way of deletion--which doesn't work because when I push, I need those config files to be there on the other end, and not deleted by the push.
I thought I'd be smart and start using git. It's excellently verbose, thusly confusing for newp.
I thought:
I could have a master and staging on production(prod), and a master and staging on dev(dev);
I would dev on the dev>staging branch, approve the gradients and other changes, then push to prod>staging;
On prod, git checkout staging and view to make sure it works;
All being OK, merge prod>staging prod>master, and checkout prod>master for the live site.
I'd then pull prod>master into dev>master, merge dev>master with dev>staging (or not, if they're the same), and start the cycle over again on dev>staging.
They are using different db's so as not to pollute prod while developing, and it's important to keep them separate.