最近刚好用到Gitblit来管理源码, 顺手记录一下拆箱过程. (OS: Windows Server 2012 r2
)
1. What is Gitblit?
Gitblit 是一个纯 Java 库用来管理, 查看和处理 Git 资料库. 相当于 Git 的 Java 管理工具.
摘自官网的介绍:
Gitblit is an open-source, pure Java stack for managing, viewing, and serving Git repositories.
It’s designed primarily as a tool for small workgroups who want to host centralized repositories.
2. install on windows
安装环境
- server os :
windows server 2012
- client os :
windows 7
/windows 10
- protocol :
http
/https
- client IDE :
git bash
- server os :
分步安装
step 0: install Gitblit on windows server 2012
1234567891011121314151617// @note this version Gitblit need jdk 1.8+, not support jdk1.6 of my computer// STRUCTION(, 及入门级配置参数)Gitblit 1.8.0- data- defaults.properties // default config- gitblit.properties // diy config- git.repositoriesFolder = F:/other/gitblitServer // git lib 根目录- server.httpPort = 65530 // http server port- server.httpsPort = 65531 // https server port- server.httpBindInterface = // 当需要用外网ip访问时, 置空即可. 初始值为 localhost- server.httpsBindInterface = // 置空即可- server.certificateAlias = // 置空即可- gitblit.cmd // start server bat- installService.cmd // install on windows's service- uninstallService.cmd // uninstall on windows's service// 配置环境的时候, 若执行.cmd不成功, 最好加入`pause`进行问题定位, 跟调.bat脚本一样.step 1: hello world
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172# cloneAdministrator@XXXXX MINGW64 /f/other/SpaceWork$ git clone http://hunan@www.qipeiyihao.com:65532/r/test.gitCloning into 'test'...Checking connectivity... done.warning: remote HEAD refers to nonexistent ref, unable to checkout.# show current branch$ git branch* master# modify some files# push files, occure errorAdministrator@XXXXX MINGW64 /f/other/SpaceWork/test (master)$ git push http://hunan@www.qipeiyihao.com:65532/r/test.git master mastererror: dst ref refs/heads/master receives from more than one src.error: failed to push some refs to 'http://hunan@www.qipeiyihao.com:65532/r/test.git'# push files, 当 远程分支名 === 本地分支名 时, 更正push 命令为:# git push 远程分支 本地分支名Administrator@XXXXX MINGW64 /f/other/SpaceWork/test (master)$ git push http://hunan@www.qipeiyihao.com:65532/r/test.git masterCounting objects: 3, done.Writing objects: 100% (3/3), 234 bytes | 0 bytes/s, done.Total 3 (delta 0), reused 0 (delta 0)remote: Updating references: 100% (1/1)To http://hunan@www.qipeiyihao.com:65532/r/test.gitd7886f6..2111368 master -> master# init mergetool and difftool$ git config --global diff.tool bc3$ git config --global difftool.bc3.path "C:\Program Files (x86)\Beyond Compare 3\BComp.exe"$ git config --global merge.tool bc3$ git config --global mergetool.bc3.path "C:\Program Files (x86)\Beyond Compare 3\BComp.exe"# git merge use mergetoolAdministrator@XXXXX MINGW64 /f/other/SpaceWork/test (master|MERGING)$ git mergetoolMerging:1.txtNormal merge conflict for '1.txt':{local}: modified file{remote}: modified file# deal done different modify, add file again, and u must delete tmp file like `YYYY.orig` after deal done different modifyAdministrator@XXXXX MINGW64 /f/other/SpaceWork/test (master|MERGING)$ git add 1.txt# git add successAdministrator@XXXXX MINGW64 /f/other/SpaceWork/test (master|MERGING)$ git statusOn branch masterYour branch is ahead of 'origin/master' by 2 commits.(use "git push" to publish your local commits)All conflicts fixed but you are still merging.(use "git commit" to conclude merge)Changes to be committed:modified: 1.txtUntracked files:(use "git add <file>..." to include in what will be committed)1.txt.orig# git commitAdministrator@XXXXX MINGW64 /f/other/SpaceWork/test (master|MERGING)$ git commit -m 'done-merge'[master b4621cb] done-mergestep 2:
Beyond Compare 3
config1234# install pathC:\Program Files (x86)\Beyond Compare 3\BComp.exe# Gitblit pathF:\other\gitblit-1.8.0\gitblit.cmd