PS: do one or the other, but not both as you'll have undesirable side-effects. When pulling, the remote version of the file should overwrite yours. Warning: if your friends also want to modify this class, they have to have the same setup, otherwise their modifications would be pushed to the remote repository. The modifications you do will follow you whatever the branch. 5: Go back to work on another functionnality.4: Update your configuration class with your own parameters.3: git update-index -skip-worktree MySetupClass.java.2: Commit and push it to the remote server.1: Create a first version of this class, fill in fields you can fill and leave others empty/null.including passwords) that your friends have to change accordingly to their setup. You have a setup class containing parameters (eg. I like to use it when I only want to stop tracking changes for a while + commit a bunch of files ( git commit -a) related to the same modification. It actually only hides modifications ( git status won't show you the flagged files). If you pull with this option activated, you'll need to solve conflicts and git won't auto merge. But when checking out to another branch, you need to reset the flag and commit or stash changes before so. It assumes this file should not be modified, and gives you a cleaner output when doing git status. skip-worktree will follow you whatever the branch you checkout, with your modifications!.If you want to hide modifications done to a file, modify the file, then checkout another branch, you'll have to use no-assume-unchanged then probably stash modifications done. assume-unchanged is to temporary allow you to hide modifications from a file.It will keep your local file, but will be marked as removed from the remote repository.)ĭifference between the first two options? (The third option, which you probably don't want is: git rm -cached. What you probably want to do is this: git update-index -skip-worktree. Indeed, this may be a good solution, but only in the short run. Lots of people advise you to use git update-index -assume-unchanged. Note that to undo either #2 or #3, you can use the variant of the respective commands: git update-index -no-assume-unchanged It's important to know that git update-index will not propagate with Git, so each user will have to run it independently. For instance, you don't want to overwrite (or delete) production/staging config files. This is to tell Git that you want your own independent version of the file or folder. The assume-unchanged index will be reset and file(s) overwritten if there are upstream changes to the file/folder (when you pull). It tells Git to stop checking that huge folder every time for changes, locally, since it won't have any. This is for optimization, like a folder with a large number of files, e.g. This will keep the local file for you, but will delete it for anyone else when they pull.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |