简体   繁体   English

在github上可视化git存储库

[英]Visualize git repository on github

I have a repository on github and i want a tool that produces a visualization video like this: 我在github上有一个存储库,我想要一个生成可视化视频的工具,如下所示:

Koha Library Software History Visualization Koha图书馆软件历史可视化

is there a step by step tutorial to make such a video in windows ? 有没有一步一步的教程在Windows中制作这样的视频?

gource维基有很好的信息,如何做到这一点。

Something not explained in the docs; 文档中没有解释的东西; In a standard Windows GIT install the path to the git binary is not added to windows PATH environment variable by default. 在标准的Windows GIT安装中,默认情况下,git二进制文件的路径不会添加到Windows PATH环境变量中。 Instead GIT uses it's own command-prompt on windows. 相反,GIT在Windows上使用它自己的命令提示符。 Thus running gource from the windows command-prompt will result in git not being found. 因此,从Windows命令提示符运行gource将导致找不到git。

To enable git from standard windows command-prompt you will need to add it to the PATH environment variable. 要从标准Windows命令提示符启用git,您需要将其添加到PATH环境变量中。

From the windows command-prompt type (where C:\\Program Files (x86)\\Git\\bin is the path to git on your computer): 从Windows命令提示符类型(其中C:\\ Program Files(x86)\\ Git \\ bin是计算机上git的路径):

set path=%path%;C:\Program Files (x86)\Git\bin

如果有人只想要一个衬里复制粘贴,请使用它(需要ffmpeglibx264 ):

gource -1280x720 -o - | ffmpeg -y -r 60 -f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast -crf 1 -threads 0 -bf 0 gource.mp4

For generating the actual video in Windows (with Gource), check out the Windows section of http://code.google.com/p/gource/wiki/Videos . 要在Windows中生成实际视频(使用Gource),请查看http://code.google.com/p/gource/wiki/Videos的Windows部分。 There is a related command run at an old SO post at Gource on Windows . 在Windows上的Gource的旧SO帖子上运行了一个相关的命令。 The instructions here: http://nooshu.com/visualising-subversion-with-gource show how to generate a gource log file for svn, which gource can then play back. 这里的说明: http ://nooshu.com/visualising-subversion-with-gource显示如何为svn生成一个gource日志文件,然后gource可以回放。 The git variation should be similar. git变体应该类似。 Note that the original question concerned Gource. 请注意,原始问题涉及Gource。

#!/bin/bash
# This is script of the generation video from "Gource".

# project: Screensaver Kodi Universe (http://berserk.tv)
# This script creates a ZIP archive of a Kodi screensaver.
# GNU GENERAL PUBLIC LICENSE. Version 2, June 1991
# 
OUT_DIR="output"
OUT="kodi-universe.mkv"
NAME_PROJ="screensaver.kodi.universe"
MEDIA_PATH="${NAME_PROJ}/resources/skins/default/media"
NAME_REP="https://github.com/berserktv/${NAME_PROJ}.git"

GSFILE="output.ppm"
SECONDS_PER_DAY="1"
GOURCE_FRAME_RATE="30"
RESOLUTION="-1920x1080"
CODEC_OUT_FRAME_RATE="25"

FFPARAM="-vcodec libx264 -profile:v high422 -pix_fmt yuv420p"
GSPARAM1="--camera-mode track ${RESOLUTION} --stop-position 1.0 --seconds-per-day ${SECONDS_PER_DAY}"
GSPARAM2="--git-branch origin/master --multi-sampling --stop-at-end --hide-filenames"
GSPARAM3="--highlight-users --file-idle-time 13 --max-files 0 --hide date"
GSPARAM4="--title Kodi --bloom-multiplier 1.0 --bloom-intensity 1.0"

VIS="visualize"
GIT_REP="https://github.com/xbmc/xbmc.git"
# arg1 - Git Project PATH
# example: ./create.sh "https://github.com/facebook/react.git"
if [ -n "$1" ]; then GIT_REP="$1"; fi

# INSTALL PACKAGE git zip ffmpeg gource
packages="git zip ffmpeg gource"
for i in $packages; do
  if ! dpkg -s $i | grep -q "install ok installed"; then sudo apt-get install -y $i; fi
done 

test -d ${OUT_DIR} || mkdir -p ${OUT_DIR}
cd ${OUT_DIR}
# download screensaver Kodi Universe и GIT for Visualization
if ! git clone ${NAME_REP} ${NAME_PROJ}; then echo "Error, not load ${NAME_REP}, exit ..."; exit 1; fi
if ! git clone ${GIT_REP} ${VIS};        then echo "Error, not load ${GIT_REP},  exit ..."; exit 2; fi


gource ${VIS} ${GSPARAM1} ${GSPARAM2} ${GSPARAM3} ${GSPARAM4} --output-framerate ${GOURCE_FRAME_RATE} --output-ppm-stream ${GSFILE}
ffmpeg -y -r ${GOURCE_FRAME_RATE} -f image2pipe -vcodec ppm -i ${GSFILE} ${FFPARAM} -r ${CODEC_OUT_FRAME_RATE} ${OUT} && sync
mv -f ${OUT} ${MEDIA_PATH}
rm -f ${GSFILE}
zip -r ${NAME_PROJ}.zip ${NAME_PROJ}

Well, that video was created using Gource . 那个视频是用Gource创建的。 It understands Git logs and there's a Windows version. 它了解Git日志,并且有Windows版本。 Also, there's a Wiki write-up on creating videos with it here. 此外,还有一篇关于用它创建视频的Wiki文章

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM