Benutzer-Werkzeuge

Webseiten-Werkzeuge


snippets

Unterschiede

Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.

Link zu der Vergleichsansicht

Beide Seiten, vorherige ÜberarbeitungVorherige Überarbeitung
Nächste Überarbeitung
Vorherige Überarbeitung
snippets [2018/03/14 16:19] – added long git config paragraphs ojdosnippets [2022/11/03 09:45] (aktuell) ojdo
Zeile 21: Zeile 21:
 [color] [color]
  ui = auto  ui = auto
 +
 +[init]
 + defaultBranch = main
  
 [alias] [alias]
Zeile 32: Zeile 35:
  ls = log --pretty=format:'%C(dim white)%m%C(dim green)%h %C(dim cyan)%cd %C(reset)%s %C(cyan)%aN%C(auto)%d%Creset' --decorate --date=short  ls = log --pretty=format:'%C(dim white)%m%C(dim green)%h %C(dim cyan)%cd %C(reset)%s %C(cyan)%aN%C(auto)%d%Creset' --decorate --date=short
  nl = "!author_names() { git log --pretty=format:'%aN' -- "${@-.}" | sort | uniq -c | sort -n -r; }; author_names"  nl = "!author_names() { git log --pretty=format:'%aN' -- "${@-.}" | sort | uniq -c | sort -n -r; }; author_names"
 + s = status
  
 [merge] [merge]
Zeile 38: Zeile 42:
 [log] [log]
  date = format:%Y-%m-%d %H:%M  date = format:%Y-%m-%d %H:%M
- graphColors = 20,120,220,21,121,2+ graphColors = 1,2,3,4,5,6,7,8,46,63,124,136,148,160,172,184,196,208,201,220,228
  
 [push] [push]
  default = simple  default = simple
 +
 +[pull]
 + ff = only
  
 [core] [core]
Zeile 49: Zeile 56:
 ==== Aliases ==== ==== Aliases ====
  
-My main workhorse in day-to-day work is the ''lg'' (log graph) command, allowing for a quick overview on latest changes with ''git lg --all'' after a fetch. In case I want briefer output for a linear slice of commits, I use ''ls'' short (no graph). If I want to additionally see the changed files, ''ll'' (log long) can be used. Meta-alias ''al'' (alias list) does exactly that. +My main workhorse in day-to-day work is the ''lg'' (log graph) command, allowing for a quick overview on latest changes with ''git lg %%--%%all'' after a fetch. In case I want briefer output for a linear slice of commits, I use ''ls'' short (no graph). If I want to additionally see the changed files, ''ll'' (log long) can be used. Meta-alias ''al'' (alias list) does exactly that. 
  
-Saying ''git dc'' instead of ''git diff --cached'' for a commit preview is very nice. I hardly remember the ''git d'' instead of ''git diff'', though. But then, typing that out does not hurt too much. Newcomer: ''bl'' (branch list) lists all local branches, together with its latest commit. It's designed to look similar to the output of ''lg''. I might extend it to output remotes in red; it already can list them by calling ''git bl refs/remotes''.+Saying ''git dc'' instead of ''git diff %%--%%cached'' for a commit preview is very nice. I hardly remember the ''git d'' instead of ''git diff'', though. But then, typing that out does not hurt too much. Newcomer: ''bl'' (branch list) lists all local branches, together with its latest commit. It's designed to look similar to the output of ''lg''. I might extend it to output remotes in red; it already can list them by calling ''git bl refs/remotes''.
  
 The ''nl'' (name list) lists all commit authors for the current state (HEAD). The optional argument allows to specify a directory or file, by default it operates on the current working directory (''.''). Quite useful to quickly determine the contributors for a particular component. The ''nl'' (name list) lists all commit authors for the current state (HEAD). The optional argument allows to specify a directory or file, by default it operates on the current working directory (''.''). Quite useful to quickly determine the contributors for a particular component.
Zeile 63: Zeile 70:
  
 ==== log ==== ==== log ====
 +
 +My preferred ISO-inspired default date format, but without the unneeded precision of seconds. Date and time are split by a space, not the standard ''T'' which makes ''20010214T2359'' easier to parse, but harder to read. The graphColors allow to specify which of the (typically) 256 terminal colours are used to differentiate between different branches. Here I recommend using much more than the (randomly) chosen 5 values I have shown here.
 +
  
  
snippets.1521044385.txt.gz · Zuletzt geändert: 2018/03/14 16:19 von ojdo