What is the Git equivalent of capturing ClearCase?

My team recently migrated from ClearCase to Git. Some team members are used to capturing files, which in ClearCase means making private changes to the tracked file, changes that you are not going to use for anyone.

ClearCase basically ignores such files when executing the Git add / commit equivalent and does not overwrite them when executing the Git pull equivalent.

Is there an equivalent in git?

Note. I am not saying that this is a good workflow, even in the ClearCase world. The answer to the question "why do you want" is what they are used to.

+4
source share
2 answers

The closest approximation to " hijacked " will be the file for which you specify the git index, which it should ignore:
(See " Git: scan a file only in a local repo and save it to a remote repository )

git update-index --assume-unchanged -- afile. 

The file is still being versioned, but any modification you make in it will not be displayed in git status and will not be committed (and will not be clicked, obviously)

+4
source

You can always make changes and then not commit them. Changes will float when you pull / merge / lock / check; if you try to do something that overwrites them (for example, you merge a change concerning the same file), it will refuse - from that moment you can git stash to make changes, perform the operation, and then git stash (apply|pop) to restore the changes.

If you want these changes to be made locally, but not transferred to anyone else, I believe that your best choice is to support them in the local branch where you are rebuilding (or maintaining the merger) the industry "actual development" and just be careful not to actually push commit (s) that contain local changes.

-one
source

All Articles