| Start |
|---|
| List / search existing aliases You can list existing git aliases (opens new window) using Searching aliasesTo search aliases (opens new window), add the following to your Then you can:
|
| Simple aliases There are two ways of creating aliases in Git:
After the alias is created - type:
As with regular git commands, aliases can be used beside arguments. For example: |
| Advanced Aliases Git lets you use non-git commands and full In your The fact that full shell syntax is available in these prefixed aliases also means you can use shell functions to construct more complex aliases, such as ones which utilize command line arguments: The above alias defines the In fact, this pattern is so useful that Git defines Note that aliases prefixed with |
| Temporarily ignore tracked files To temporarily mark a file as ignored (pass file as parameter to alias) - type: To start tracking file again - type: To list all files that has been temporarily ignored - type: To clear the unwatched list - type: Example of using the aliases: |
Show pretty log with branch graph Here an explanation of the options and placeholder used in the --graph - draw the commit tree --date-order - use commit timestamp order when possible --first-parent - follow only the first parent on merge node. --branches - show all local branches (by default, only current branch is shown) --all - show all local and remotes branches %h - hash value for commit (abbreviated) %ad - Date stamp (author) %an - Author username %an - Commit username %C(auto) - to use colors defined in [color] section %Creset - to reset color %d - --decorate (branch & tag names) %s - commit message %ad - author date (will follow --date directive) (and not commiter date) %an - author name (can be %cn for commiter name) |
| Updating code while keeping a linear history Sometimes you need to keep a linear (non-branching) history of your code commits. If you are working on a branch for a while, this can be tricky if you have to do a regular This will update with your upstream source, then reapply any work you have not pushed on top of whatever you pulled down. To use: |
See which files are being ignored by your .gitignore configuration Shows one line per file, so you can grep (only directories): Or count: |
| Unstage staged files Normally, to remove files that are staged to be committed using the
Now, any time you want to unstage stages files, type |
Read Article
https://develop.horje.com/learn/1434/reference