Revisions .bashrc Profile Configuration For Colors And Git Branch

I'm currently using git-prompt.sh to customize my bash prompt (PS1) to show a status of my git repo in my bash prompt. This stackoverflow answer was very helpful but not exactly what I'm looking for. My current.bashrc appears like this: aj@computer-name mycurrentworkingdirectory (git-branch-name)$ My.gitconfig uses the following: color. The shell variable PS1 holds your bash prompt. $(gitps1 '%s'): your current git branch if you're in a git directory, otherwise nothing. Colors have to be escaped (see General), color codes should be followed. To your.bashrc or.profile. Fi`e00;37mue01;37m:` $(git status 2 /dev/null) = Changes to be.

Download files recovery for moka virus

.I'm using Git on Windows, installed through GitExtensions with MSysGit (latest) having selected 'do not modify my Windows prompt' during installation. Now, I would like to be able to modify the default prompt (which by default shows just the branch name to also show me how much time, and how many local commits since I last pushed to origin (or specifically origin/master, whichever is easier). So say instead of: me@myPC /c/myRepo (master) I would see something along the lines of: me@myPC /c/myRepo (master) 5 10:20 meaning I have last pushed 10h 20min ago and I have made 5 local commits since. Before you mention it, I am aware there are ways of doing it with PowerShell, but I don't want to use it. I want my standard git bash we all know and love.

I found a few solutions to that, with modifying PS1 variable in.bashrc file, but (excuse my poor Unix konwledge) they seem to be not working, (for example accepted answer to question). So there you have it.

Revisions.bashrcprofile Configuration For Colors And Git Branch CodeColor.branch color.diff color.interactive color.status In addition, each of these has subsettings you can use to set specific colors for parts of the output, if you want to override each color. For example, to set the meta information in your diff output to blue foreground, black background, and bold text, you can run.

The color.ui is a meta configuration that includes all the various color. configurations available with git commands. This is explained in-depth in git help config.

So basically it's easier and more future proof than setting the different color. settings separately.Is this possible?

Git

The default git-completion script supports part of what you are after.If you set GITPS1SHOWUPSTREAM='verbose git' in the /etc/profile file then it will add the number of commits ahead of your upstream branch into the prompt. You may need to set the prompt as below to include a (%s) in the git specific part: export PS1=' 0330;$MSYSTEM: w 007 03332m u@ h 03333m w$(gitps1 ' (%s)') 0330m $ ' For the time part - thats new to me. But the git-bash should handle any unix version you may have found.Just edit /etc/profile as administrator (its actually%PROGRAMFILES% Git etc profile or create a /.profile file containing the following: GITPS1SHOWDIRTYSTATE=1 GITPS1SHOWUPSTREAM='verbose git' export GITPS1SHOWDIRTYSTATE GITPS1SHOWUPSTREAM with these environment variables set, the default msysGit prompt looks like this if you have a dirty tree with 1 commit ahead of origin: pat@FROG /c/src/msysgit (devel. U+1) $ git status -short -branch ## devel.origin/devel ahead 1 M doc/git/html M etc/inputrc.If you run GitPortable for Windows you may want to do this trick taken from Write $ nano /.bashrc in gitportable console. After you have done editing write $ source /.bashrc to reload settings. My installation saves a file in C: apps GitPortable Data home folder. # Git-friendly prompt showing dirty state # shopt -s promptvars export GITPS1SHOWDIRTYSTATE=1 export GITPS1SHOWUPSTREAM='verbose git' export PS1=' 0331;36m 0330m 0331;34m w 0330m 0331;32m $(gitps1) 0330m $ ' # Enable color support of ls alias ls='ls -color=auto -alhX'.