Git help: Difference between revisions

From Phobos Wiki
Jump to navigation Jump to search
(Uus lehekülg: '== Git on linux == === show current branch in terminal === <syntaxhighlight lang="bash"> PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)") \[\033[01;34m\]...')
 
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:


<syntaxhighlight lang="bash">
<syntaxhighlight lang="bash">
source /etc/bash_completion.d/git-prompt
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)") \[\033[01;34m\]$\[\033[00m\] '
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)") \[\033[01;34m\]$\[\033[00m\] '
</syntaxhighlight>
</syntaxhighlight>
* source /etc/bash_completion.d/git (for Ubuntu 12.04 or less)
* source /etc/bash_completion.d/git-prompt (for Ubuntu 13.04 and higher)
[http://stackoverflow.com/questions/9717137/displaying-git-branch-name-in-prompt-does-not-work-in-screen displaying-git-branch-name-in-prompt-does-not-work-in-screen]
=== ~/.gitconfig ===
<pre>
[user]
name = Roland Uuesoo
email = roland@martem.eu
[core]
editor = vim.tiny
  whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
  ui = auto
[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green
[color "diff"]
  meta = yellow bold
  frag = magenta bold
  old = red bold
  new = green bold
[color "status"]
  added = yellow
  changed = green
  untracked = cyan
[color]
  ui = true
[color "diff"]
  whitespace = red reverse
[alias]
  st = status
  ci = commit
  br = branch
  co = checkout
  df = diff
  dc = diff --cached
  lg = log -p
  lol = log --graph --decorate --pretty=oneline --abbrev-commit
  lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
  ls = ls-files
  # Show files ignored by git:
  ign = ls-files -o -i --exclude-standard
</pre>
==== .gitconfig sendmail (gmail) ====
<pre>
[sendemail]
chainreplyto = false
smtpserver = smtp.gmail.com
smtpserverport = 587
smtpencryption = tls
smtpuser = your@gmail.com
from = your@gmail.com
suppresscc = all
</pre>

Latest revision as of 14:47, 10 April 2015

Git on linux

show current branch in terminal

source /etc/bash_completion.d/git-prompt
PS1='\[\033[01;32m\]\h\[\033[01;34m\] \w\[\033[31m\]$(__git_ps1 " (%s)") \[\033[01;34m\]$\[\033[00m\] '
  • source /etc/bash_completion.d/git (for Ubuntu 12.04 or less)
  • source /etc/bash_completion.d/git-prompt (for Ubuntu 13.04 and higher)

displaying-git-branch-name-in-prompt-does-not-work-in-screen

~/.gitconfig

[user]
	name = Roland Uuesoo
	email = roland@martem.eu
[core]
	editor = vim.tiny
  whitespace=fix,-indent-with-non-tab,trailing-space,cr-at-eol
[color]
  ui = auto
[color "branch"]
  current = yellow reverse
  local = yellow
  remote = green
[color "diff"]
  meta = yellow bold
  frag = magenta bold
  old = red bold
  new = green bold
[color "status"]
  added = yellow
  changed = green
  untracked = cyan
[color]
  ui = true
[color "diff"]
  whitespace = red reverse
[alias]
  st = status
  ci = commit
  br = branch
  co = checkout
  df = diff
  dc = diff --cached
  lg = log -p
  lol = log --graph --decorate --pretty=oneline --abbrev-commit
  lola = log --graph --decorate --pretty=oneline --abbrev-commit --all
  ls = ls-files

  # Show files ignored by git:
  ign = ls-files -o -i --exclude-standard

.gitconfig sendmail (gmail)

[sendemail]
	chainreplyto = false
	smtpserver = smtp.gmail.com
	smtpserverport = 587
	smtpencryption = tls
	smtpuser = your@gmail.com
	from = your@gmail.com
	suppresscc = all