Git note

Git: How to view file diff before commit

You’re looking for git diff. Depending on your exact situation, there are three useful ways to use it:

It’ll work recursively on directories, and if no paths are given, it shows all changes.

Git: git ignore files only locally(Prevent local changes getting pushed in Git)

Patterns which are specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user’s workflow) should go into the $GIT_DIR/info/exclude file.

The .git/info/exclude file has the same format as any .gitignore file. You can also set core.excludesfile to the name of a file containing global patterns.

If you already have unstaged changes you must then run:

To get it back if one day you need it:

Note on $GIT_DIR: This is a notation used all over the git manual simply to indicate the path to the git repository. If the environment variable is set, then it will override the location of whichever repo you’re in, which probably isn’t what you want.

Git commads

Checkout remote branch