由于windows下没有gitlab之类的工具,只有很久没有更新的gitblit
下载Gitblit, 下载地址:http://www.gitblit.com/ 很长时间没有更新了,在没有linux环境下可以做替代品
Gitblit requires a Java 7 Runtime Environment (JRE) or a Java 7 Development Kit (JDK).
安装gitblit
解压缩下载的压缩包即可,无需安装
创建一个目录,用来存放代码库 E:\git\gitdata
修改data目录下的gitblit.properties gitblit-1.8.0\data\gitblit.properties
# 上面创建的存放代码的目录 git.repositoriesFolder = E:\用户目录\Desktop\gitblit-1.8.0\data # 设置访问的端口,不要和别的端口有冲突 server.httpPort = 9001 # RESTART REQUIRED server.httpsPort = false # 搭建服务器的IP server.httpBindInterface = 0.0.0.0 # localhost就行 server.httpsBindInterface =localhost
gitblit.cmd启动即可
添加至windows服务
因没有尝试成功,故忽略,可以尝试使用winsw
初始密码 admin admin
提交本地代码到gitbilt
创建仓库
创建成功可按照提示进行提交
$ git init Initialized empty Git repository in E:/用户目录/Desktop/login/.git/ [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ ls aaa images/ testssologin.html app/ index.html web.config assets/ js/ wechat/ Bin/ logs/ wechat_0426/ css/ MP_verify_FjPlH5sJYWPSyt3h.txt wechat_0427/ download/ NLog.config whitelist.html favicon.ico packages.config 'zhiweiTest _CallBack.html' Global.asax state.json zhiweiTest.html [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git add . warning: LF will be replaced by CRLF in app/assets/13.00f0441e.chunk.js. The file will have its original line endings in your working directory. warning: LF will be replaced by CRLF in app/assets/13.6ef4778c.chunk.js. $ git commit -m 'login 20180711' [master (root-commit) b294ed4] login 20180711 1713 files changed, 74929 insertions(+) create mode 100644 Bin/AWSSDK.Core.dll create mode 100644 wechat_0427/static/js/main.7a8f7cca.js create mode 100644 whitelist.html create mode 100644 zhiweiTest _CallBack.html create mode 100644 zhiweiTest.html [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git config --global user.email [email protected] [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git config --global user.name lisi [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git remote add origin http://[email protected]:9001/r/dangjian.git [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git remote -v origin http://[email protected]:9001/r/dangjian.git (fetch) origin http://[email protected]:9001/r/dangjian.git (push) [email protected] MINGW64 /e/用户目录/Desktop/login (master) $ git push -u origin master Enumerating objects: 922, done. Counting objects: 100% (922/922), done. Delta compression using up to 12 threads. Compressing objects: 100% (877/877), done. Writing objects: 100% (922/922), 21.23 MiB | 8.25 MiB/s, done. Total 922 (delta 190), reused 0 (delta 0) remote: Resolving deltas: 100% (190/190) remote: Updating references: 100% (1/1) To http://127.0.0.1:9001/r/dangjian.git * [new branch] master -> master Branch 'master' set up to track remote branch 'master' from 'origin'.