Вопрос по git – Симпатичные графы веток

1129

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded Uri Abramson
Error: User Rate Limit Exceeded Maksim Dmitriev
Error: User Rate Limit Exceededgithub.com/chode/git-graph Stephan Bechter
Error: User Rate Limit ExceededVisualizing branch topology in git trblnc
Error: User Rate Limit Exceededbit-booster.com/graph.htmlError: User Rate Limit Exceededmy answer. G. Sylvie Davies

Ваш Ответ

30   ответов
41

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded:

jquery sample

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
789

git log --all --decorate --oneline --graph

git log

"A Dog" = git log --all --decorate --oneline --graph

enter image description here

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
--oneline был введен в Git 1.6.3:github.com/git/git/blob/…Error: User Rate Limit Exceeded
git config --global alias.adog "log --all --decorate --oneline --graph"
105

Error: User Rate Limit ExceededError: User Rate Limit Exceeded, gitdagsError: User Rate Limit Exceeded

Error: User Rate Limit ExceedednotError: User Rate Limit ExceededgitdagsError: User Rate Limit Exceedededucational purposes.

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

enter image description here

\documentclass{article}

\usepackage{subcaption}
\usepackage{gitdags}

\begin{document}

\begin{figure}
  \begin{subfigure}[b]{\textwidth}
    \centering
    \begin{tikzpicture}
      % Commit DAG
      \gitDAG[grow right sep = 2em]{
        A -- B -- { 
          C,
          D -- E,
        }
      };
      % Tag reference
      \gittag
        [v0p1]       % node name
        {v0.1}       % node text
        {above=of A} % node placement
        {A}          % target
      % Remote branch
      \gitremotebranch
        [origmaster]    % node name
        {origin/master} % node text
        {above=of C}    % node placement
        {C}             % target
      % Branch
      \gitbranch
        {master}     % node name and text 
        {above=of E} % node placement
        {E}          % target
      % HEAD reference
      \gitHEAD
        {above=of master} % node placement
        {master}          % target
    \end{tikzpicture}
    \subcaption{Before\ldots}
  \end{subfigure}

  \begin{subfigure}[b]{\textwidth}
    \centering
    \begin{tikzpicture}
      \gitDAG[grow right sep = 2em]{
        A -- B -- { 
          C -- D' -- E',
          {[nodes=unreachable] D -- E },
        }
      };
      % Tag reference
      \gittag
        [v0p1]       % node name
        {v0.1}       % node text
        {above=of A} % node placement
        {A}          % target
      % Remote branch
      \gitremotebranch
        [origmaster]    % node name
        {origin/master} % node text
        {above=of C}    % node placement
        {C}             % target
      % Branch
      \gitbranch
        {master}      % node name and text 
        {above=of E'} % node placement
        {E'}          % target
      % HEAD reference
      \gitHEAD
        {above=of master} % node placement
        {master}          % target
    \end{tikzpicture}
    \subcaption{\ldots{} and after \texttt{git rebase origin/master}}
  \end{subfigure}
  \caption{Demonstrating a typical \texttt{rebase}}
\end{figure}

\end{document}
Error: User Rate Limit ExceededShareLatexError: User Rate Limit ExceededWriteLaTeXError: User Rate Limit Exceeded:)
Error: User Rate Limit Exceededget gitdags working from scratch on Ubuntu 14.04
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededlatex input.tex создать DVI, а затем, наконец, использоватьdvisvgm input.dviError: User Rate Limit Exceededconvert -antialias -density 300 -background none input.svg output.pngError: User Rate Limit ExceededamazingError: User Rate Limit Exceededi.imgur.com/1Xu2Ry5.png
@AndreaPolci Seegithub.com/Jubobs/gitdags/issues/3Error: User Rate Limit ExceededgitdagsError: User Rate Limit Exceeded
53

git-forestError: User Rate Limit Exceededgit logError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

It uses unicode characters to draw the lines in the graph giving a more continuous look to the graph lines. You can combine --reverse with the graph output, which is not possible with the regular git log command. It uses git log internally to grab the list of commits, so all options that you pass to git log can also be passed to this script as well.

Error: User Rate Limit Exceededgit-forestError: User Rate Limit Exceeded

[alias]
tree = "forest --pretty=format:\"%C(red)%h %C(magenta)(%ar) %C(blue)%an %C(res,et)%s\" --style=15 --reverse"

Error: User Rate Limit Exceeded

enter image description here

Error: User Rate Limit Exceeded
14

git log~/.gitconfig

[alias]
l = log --all --graph --pretty=format:'%C(auto)%h%C(auto)%d %s %C(dim white)(%aN, %ar)'

git l

enter image description here

2.12log.graphColors

--onelineauthor name.mailmaprelative author date%C(auto)1.8.3.

git log --graph --onelineError: User Rate Limit Exceeded
17

Slipp's awesome answer

[alias]
lgBranch1 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(bold white)— %an%C(reset)%C(bold yellow)%d%C(reset)' --abbrev-commit --date=relative
lgBranch2 = log --graph --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(bold white)— %an%C(reset)' --abbrev-commit
lg = !"git lg1"

--all

git lgBranch1 <branch name>

git lgBranch1 --all
4

Error: User Rate Limit Exceededgnu-sedError: User Rate Limit Exceeded

[alias]
    # tree, vtree, stree support
    logx = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset)+%C(bold black)(%cr)%C(reset)+%C(auto)%d%C(reset)++\n+++       %C(bold black)%an%C(reset)%C(bold black): %s%C(reset)'
    tree = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset) %C(auto)%d%C(reset)\n         %C(bold black)[%cr]%C(reset)  %x09%C(bold black)%an: %s %C(reset)'
    stree = !bash -c '" \
    while IFS=+ read -r hash time branch message; do \
        timelength=$(echo \"$time\" | gsed -r \"s:[^ ][[]([0-9]{1,2}(;[0-9]{1,2})?)?m::g\"); \
        timelength=$(echo \"16+${#time}-${#timelength}\" | bc); \
        printf \"%${timelength}s    %s %s %s\n\" \"$time\" \"$hash\" \"$branch\" \"\"; \
    done < <(git logx && echo);"' | less -r
    vtree = !bash -c '" \
    while IFS=+ read -r hash time branch message; do \
      timelength=$(echo \"$time\" | gsed -r \"s:[^ ][[]([0-9]{1,2}(;[0-9]{1,2})?)?m::g\"); \
      timelength=$(echo \"16+${#time}-${#timelength}\" | bc); \
      printf \"%${timelength}s    %s %s %s\n\" \"$time\" \"$hash\" \"$branch\" \"$message\"; \
    done < <(git logx && echo);"' | less -r

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

34

git tree, git streegit vtree

[alias]
    tree = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset) %C(auto)%d%C(reset)\n         %C(black)[%cr]%C(reset)  %x09%C(black)%an: %s %C(reset)'
enter image description here

git streegit vtree

[alias]
    logx = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset)+%C(dim black)(%cr)%C(reset)+%C(auto)%d%C(reset)++\n+++       %C(bold black)%an%C(reset)%C(black): %s%C(reset)'
    stree = !bash -c '"                                                                             \
        while IFS=+ read -r hash time branch message; do                                            \
            timelength=$(echo \"$time\" | sed -r \"s:[^ ][[]([0-9]{1,2}(;[0-9]{1,2})?)?m::g\");     \
            timelength=$(echo \"16+${#time}-${#timelength}\" | bc);                                 \
            printf \"%${timelength}s    %s %s %s\n\" \"$time\" \"$hash\" \"$branch\" \"\";          \
        done < <(git logx && echo);"'

git_stree

[alias]
    logx = log --all --graph --decorate=short --color --format=format:'%C(bold blue)%h%C(reset)+%C(dim black)(%cr)%C(reset)+%C(auto)%d%C(reset)++\n+++       %C(bold black)%an%C(reset)%C(black): %s%C(reset)'
    vtree = !bash -c '"                                                                             \
        while IFS=+ read -r hash time branch message; do                                            \
            timelength=$(echo \"$time\" | sed -r \"s:[^ ][[]([0-9]{1,2}(;[0-9]{1,2})?)?m::g\");     \
            timelength=$(echo \"16+${#time}-${#timelength}\" | bc);                                 \
            printf \"%${timelength}s    %s %s %s\n\" \"$time\" \"$hash\" \"$branch\" \"$message\";  \
        done < <(git logx && echo);"'

git_vtree

EDIT:

fatal: bad color value 'auto' for variable '--pretty format' :(
Error: User Rate Limit Exceededsed: illegal option -- r
Error: User Rate Limit Exceeded
25
This is my take on this matter: Screenshot:

Screenshot

Usage:

git histError: User Rate Limit Exceeded

git hist --allError: User Rate Limit Exceeded

git hist master develError: User Rate Limit Exceeded

git hist --branchesError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded--topo-orderError: User Rate Limit Exceeded

Benefits: Looks just like plain --decorate, so with separate colors for different branch names Adds committer email Adds commit relative and absolute date Sorts commits by date Setup:
git config --global alias.hist "log --graph --date-order --date=short \
--pretty=format:'%C(auto)%h%d %C(reset)%s %C(bold blue)%ce %C(reset)%C(green)%cr (%cd)'"
12

Error: User Rate Limit ExceededDia
Error: User Rate Limit Exceededgitgraphjs.comError: User Rate Limit ExceededreallyError: User Rate Limit Exceeded
2

git config --global alias.tre "log --graph --decorate --pretty=oneline --abbrev-commit --all --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)'"
Error: User Rate Limit Exceeded
6

        +--------+
        | hotfix |
        +---+----+
            |
--*<---*<---*
       ^ 
       |
       \--*<---*
               |
           +---+----+
           | master |
           +--------+

java -jar ditaa0_9.jar ascii-graph.txt

enter image description here

.

Error: User Rate Limit Exceededcasual-effects.com/markdeepError: User Rate Limit Exceeded
56

preview

57

Error: User Rate Limit Exceeded

enter image description here

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
И затем после удаления не забудьте привести в порядок свои привилегии безопасности Google, которые вы предоставили ранее:myaccount.google.com/security  - & GT; Подключенные приложения и сайты - & gt; Приложения, подключенные к вашей учетной записи - & gt; Управление приложениями
10

gitkgitk --all

36

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

simple plot

Error: User Rate Limit Exceededgit log --graphError: User Rate Limit ExceededError: User Rate Limit Exceeded):

24-way git octopus merge. Original URL was <code>http://lwn.net/images/ns/kernel/gitk-octopus.png</code>

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededlwn.net/images/ns/kernel/gitk-octopus.pngError: User Rate Limit Exceededclojure-log.n01se.net/date/2008-12-24.htmlError: User Rate Limit Exceeded
305

Error: User Rate Limit Exceeded

git log --graph --abbrev-commit --decorate --date=relative --all

Error: User Rate Limit Exceeded

git log --graph --oneline --decorate --all

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceededgitx, gitk --allError: User Rate Limit Exceededgitnub.

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded--abbrev-commit --decorateError: User Rate Limit Exceeded
Error: User Rate Limit Exceededgit log --graph --oneline --decorate --date=relative --allError: User Rate Limit Exceeded--dateError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
30

git log --graph --date-order -C -M --pretty=format:"<%h> %ad [%an] %Cgreen%d%Creset %s" --all --date=short

[alias]
    graph = log --graph --date-order -C -M --pretty=format:\"<%h> %ad [%an] %Cgreen%d%Creset %s\" --all --date=short
38

git log --pretty='%h|%p|%d'

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
10
git -c core.pager='less -SRF' log --oneline --graph --decorate

less

example output

27

gitgError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded

Error: User Rate Limit ExceededGitXError: User Rate Limit Exceeded
1645

Update: This answer has gotten far more attention than it deserves.  It was originally posted because I think the graphs look nice and they could be drawn-over in Illustrator for a publication– and there was no better solution.  But there now exists much more applicable answers to this Q, such as Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Update 2: I've posted an improved version of this answer to the Error: User Rate Limit ExceededError: User Rate Limit Exceeded lg3, which shows both the author and committer info, so you really should check it out.  Leaving this answer for historical (& rep, I'll admit) reasons, though I'm really tempted to just delete it.

Error: User Rate Limit Exceeded~/.gitconfigError: User Rate Limit Exceeded

[alias]
lg1 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all
lg2 = log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold cyan)%aD%C(reset) %C(bold green)(%ar)%C(reset)%C(bold yellow)%d%C(reset)%n''          %C(white)%s%C(reset) %C(dim white)- %an%C(reset)' --all
lg = !"git lg1"

git lg/git lg1Error: User Rate Limit Exceeded
git lg1

Error: User Rate Limit Exceededgit lg2Error: User Rate Limit Exceeded
git lg2

Error: User Rate Limit Exceeded#202020/#555555Error: User Rate Limit Exceeded#5d1a14/#da4939Error: User Rate Limit Exceeded#424e24/#a5c261Error: User Rate Limit Exceeded#6f5028/#ffc66dError: User Rate Limit Exceeded#263e4e/#6d9cbeError: User Rate Limit Exceeded#3e1f50/#a256c7Error: User Rate Limit Exceeded#234e3f/#62c1a1Error: User Rate Limit Exceeded#979797/#ffffff.
Error: User Rate Limit Exceededlg = log --graph --abbrev-commit --decorate --format=format:'%C(yellow)%h%C(reset)%C(auto)%d%C(reset) %C(normal)%s%C(reset) %C(dim white)%an%C(reset) %C(dim blue)(%ar)%C (reset)' --all
Error: User Rate Limit Exceeded--date=relativeError: User Rate Limit Exceeded--abbrev-commitError: User Rate Limit Exceeded%crError: User Rate Limit Exceeded%hError: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded%C(auto)Error: User Rate Limit Exceeded%dError: User Rate Limit Exceededstackoverflow.com/questions/5889878/color-in-git-log/…
9

tig

$ brew install tig
$ tig

enter image description here

2

git-colagit-dagView->DAG...git-colaLog: master ----all

24

[alias]
    #quick look at all repo
    loggsa = log --color --date-order --graph --oneline --decorate --simplify-by-decoration --all
    #quick look at active branch (or refs pointed)
    loggs  = log --color --date-order --graph --oneline --decorate --simplify-by-decoration
    #extend look at all repo
    logga  = log --color --date-order --graph --oneline --decorate --all
    #extend look at active branch
    logg   = log --color --date-order --graph --oneline --decorate
    #Look with date
    logda  = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\" --all
    logd   = log --color --date-order --date=local --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ad%Creset %C(auto)%d%Creset %s\"        
    #Look with relative date
    logdra = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\" --all
    logdr = log --color --date-order --graph --format=\"%C(auto)%h%Creset %C(blue bold)%ar%Creset %C(auto)%d%Creset %s\"  

    loga   = log --graph --color --decorate --all

    # For repos without subject body commits (vim repo, git-svn clones)
    logt  = log --graph --color --format=\"%C(auto)%h %d %<|(100,trunc) %s\"
    logta  = log --graph --color --format=\"%C(auto)%h %d %<|(100,trunc) %s\" --all        
    logtsa = log --graph --color --format=\"%C(auto)%h %d %<|(100,trunc) %s\" --all --simplify-by-decoration 

--color: clear look --graph: visualize parents --date-order: most understandable look at repo --decorate: who is who --oneline: Many times all you need to know about a commit --simplify-by-decoration: basic for a first look (just tags, relevant merges, branches) --all: saving keystrokes with all alias with and without this option --date=relative (%ar): Understand activity in repo (sometimes a branch is few commits near master but months ago from him)

Очень хорошо. Добавив их в мой конфиг. Но я рекомендую изменить% Cred% d% Creset на% C (auto)% d% Creset, который даст разные цвета для имен удаленных или локальных веток
73

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

Error: User Rate Limit Exceeded

linux-git

linux-2.6

199

Error: User Rate Limit ExceededError: User Rate Limit Exceeded

   template: "blackarrow",
   mode: "compact",
   orientation: "horizontal",
   reverseArrow: true
});

var master = gitGraph.branch("master").commit().commit();
var develop = gitGraph.branch("develop").commit();
master.commit();
develop.commit().commit();
develop.merge(master);

sample graph generated with Gitgraph.js

Error: User Rate Limit ExceededmetroError: User Rate Limit Exceeded

GitGraph.js metro theme

Error: User Rate Limit Exceeded

GitGraph with commit messages

Error: User Rate Limit ExceededError: User Rate Limit Exceeded.

Error: User Rate Limit ExceededError: User Rate Limit ExceededError: User Rate Limit Exceeded

Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededjsfiddle.net/guan1oz1Error: User Rate Limit Exceeded
Error: User Rate Limit Exceeded
Error: User Rate Limit Exceededgithub.com/bsara/git-grapher
6

Error: User Rate Limit Exceededgithub.com/DmitryBaranovskiy/raphael/graphs/impact)
Error: User Rate Limit Exceeded
@ SlippD. Этот код сейчас находится наgithub.com/DmitryBaranovskiy/raphaeljs.com/tree/master/github
4

Error: User Rate Limit Exceeded

gke='\gitk --all $(git log -g --pretty=%h)'
glg='git log --stat'
glgg='git log --graph'
glgga='git log --graph --decorate --all'
glgm='git log --graph --max-count=10'
glgp='git log --stat -p'
glo='git log --oneline --decorate'
glog='git log --oneline --decorate --graph'
gloga='git log --oneline --decorate --graph --all'
glol='git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit'
glola='git log --graph --pretty='\''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset'\'' --abbrev-commit --all'
5

Error: User Rate Limit Exceededgithub.com/gugod/bin/blob/master/git-graphvizError: User Rate Limit ExceededioError: User Rate Limit Exceeded

Похожие вопросы