Gitlab & Git cheatsheet
我们用gitlab
来管理代码。很容易安装与使用。尤其是用docker
的情况下。这里简记下。同时也把常用的git
命令记录下。
安装
官方文档写的很清楚。看这里就好
常见问题
- 迁
gitlab
到另台服务器后,再启动gitlab
报permission
问题
docker exec -it gitlab update-permissions
或者
docker-compose exec gitlab update-permissions
git 常用操作
git pull
后悔了,想回退到之前的状态git reflog # 找到要回退的那个 hash git reset --hard <hash>
比较某文件与之前几个版本的差异
git diff HEAD~~ conf.py # 有几个 ~ 就是之前几个版本 git diff HEAD~~ HEAD~ conf.py
git
走代理git config --global https.proxy 'http://127.0.0.1:1080' git config --global https.proxy 'https://127.0.0.1:1080' git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080' git config --global --unset http.proxy git config --global --unset https.proxy