Reputation: 21
I know this seems to have multiple duplicates but there is no real solution mentioned anywhere.
Let's put a real world example:
For testing, I've to load a model in my application 25 times a day. I'm getting a MessageBox that the model isn't created with the newest version of our software every time I load it. I know what I do so in my local copy I outcomment this check for faster testing. Of course I don't want to push this change, just keep it locally over the next few months or so while updating and adding new functionality to the project every day. I want to do the same thing with different files in different situations, so the process should be easy and fast.
I've read about stashing, but as far as I get it, it basically means:
This process has to be done every time you commit or update.
Hmmm... I mean, are they serious? In SVN you simply commit (means push) what you want to commit and leave all other things alone. Finished. If you update your working copy the changed file is merged of course. If there should be a conflict while merging (happens in 1 of 10000 cases) you are notified and must solve it. After you solved the conflict in your local copy updating works fine again. Done.
So the difference seems to be that SVN lets you decide what belongs to the shared repository while git demands that all repositories are always in the same state or will be after your commit/push. If you need different data you have to use complicated work arounds all the time.
Is that true or do I miss something here?
Upvotes: 2
Views: 782
Reputation: 19025
Unless I misunderstand what you are asking, simply refrain from doing a git add
on the files you do not want to commit (just as you would refrain from committing them in SVN). Alternatively, do a git update-index --assume-unchanged <file>
, and your file will not be added when you do a git add --all
.
Upvotes: 3