项目准备使用Git,操作系统环境是windows 2003。阿里云的机器,不能再安装linux的虚拟机。搜索了一些资料,尝试了两种安装方法:
What is Gitblit?
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.
GO: Single-Stack Solution
Gitblit GO is an integrated, single-stack solution based on Jetty.
You do not need Apache httpd, Perl, Git, or Gitweb. Should you want to use some or all of those, you still can; Gitblit plays nice with the other kids on the block.
This is what you should download if you want to go from zero to Git in less than 5 mins.
Open data/gitblit.properties in your favorite text editor and make sure to review and set:
server.httpPort andserver.httpsPort
server.storePassword (do not enter # characters)
https is strongly recommended because passwords are insecurely transmitted form your browser/git client using Basic authentication!
git.packedGitLimit (set larger than the size of your largest repository)
3、Execute authority.cmd or java -cp gitblit.jar com.gitblit.authority.Launcher --baseFolder data from a command-line
生成https的证书。(如果打算直接用http,那么此步骤可以不做)
fill out the fields in the new certificate defaults dialog
enter the store password used in server.storePassword when prompted. This generates an SSL certificate for localhost.
you may want to generate an SSL certificate for the hostname or ip address hostnames you are serving from
NOTE: You can only have one SSL certificate specified for a port.
exit the authority app
Enter the default administrator credentials: admin / admin and click the Login button
NOTE: Make sure to change the administrator username and/or password!!
date /T > README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin ssh://admin@127.0.0.1:29418/test.git
git push -u origin master
以上命令需要先在服务器上创建一个目录(只是临时使用,真正的版本库不是存放在这个目录),cmd到这个目录,然后执行。
git config --global http.sslVerify false
否则会报错
fatal: unable to access 'https://******/r/test.git/': SSL certificate problem: self signed certificate in certificate chain