别名
git config --global alias.ck checkout
git config --global alias.br branch
git config --global alias.ct commit
|
提交流程
git add <file/dir> git commit -m "some info" git push
|
创建分支
git checkout -b <branch name>
|
更新.gitignore
git rm -r --cached . // 删除本地缓存 git add . // 添加要提交的文件 git commit -m 'update .gitignore' // 更新本地的缓存
|
拉取远端分支
git pull <branch name> origin/<branch name>
|
合并代码-拒绝合并不相关的历史
合并代码时出现refusing to merge unrelated histories报错
在merge后加入--allow-unrelated-histories即可
git merge <branch name> --allow-unrelated-histories
|
git pull命令
git pull的命令是由两个命令组成,git fetch和git merge
查看服务器名称
设置代理
问题:不能连接到github.com
如果使用vpn代理需要设置代理
git config --global http.proxy 127.0.0.1:10809 git config --global https.proxy 127.0.0.1:10809
|
查看git配置
LFS 大文件存储
git lfs可以用于上传大文件
上传
git init git lfs install git lfs track * git add .gitattributes git commit -m "pre" git remote add origin https://github.com/Youpeng-Zhang/MOP.git git push origin master git add * git commit -m "Git LFS commit" git push origin master
|
下载
git lfs clone git@bitbucket.org:tpettersen/Atlasteroids.git git lfs fetch
|