This work was for fun, when i was tired to do all the times git branch and git status, just to know what was untracked, modified, etc, or even to know if i had some work stashed (real problems can happen if you forget your stashed work 😬 ...).
- Show the name of the working branch
- Identifies:
- untracked
% - unstaged
* - staged
+ - stashed
$ - Difference between HEAD and its upstream
<indicates you are behind>indicates you are ahead<>indicates you have diverged=indicates that there is no difference
- untracked
- Some colour in the prompt of macOS terminal
lscommand shows colours for different types of files and folders- type
gitmenuto bring up the menu
- Only loads the git identifiers when you open the terminal in a Git repository (no need to overcharge bash when not!), but colour in the prompt of macOS terminal loads everytime
- Tested in Linux Ubuntu and macOS Mojave
-
macOS install:
- Go to your
HOMEfolder(~/), and then:- copy there the
git_pluginsfolder - copy and paste the code in the
macOS_bash.bash_profileto your.bash_profilefile (if you do not have it, create one), or other bash profile you use - Mark my code for future updates, for example:
#### START - MyGit-Autocomplete <my code> #### END - MyGit-Autocomplete
- copy there the
- Go to your
-
Linux install:
- Go to your
HOMEfolder(~/), and then:- copy there the
git_pluginsfolder - copy and paste the code in the
linux_bash.bashrcto your.bashrcfile (if you do not have it, create one), or other bash profile you use - Mark my code for future updates, for example:
#### START - MyGit-Autocomplete <my code> #### END - MyGit-Autocomplete
- copy there the
- Go to your
The fun of this work was made possible by:
- Git Documentation in the Git Homepage
- The book Git Pro
- Git web interface in GitHub (home of the files
git-completition.bashandgit-prompt.sh)
Links of information files used:
