git init
git config --global user.name 306804545@qq.com
git config --global user.email 306804545@qq.com
git branch xiongman20180516
git checkout xiongman20180516
git add .
git commit -m "first commit"
与远程仓库关联
git remote add origin https://github.com/xiongmanxiongman/ijilu.cn20180515.git
git remote add origin http://xiongman@gitlab.zailouxia.com/fe/mds.git
git push -u origin xiongman20180516
git push -u origin master
从分支拿代码
git clone -b xiongman20180523 https://github.com/xiongmanxiongman/ijilu.cn20180515.git 起个新名字
git clone -b xiongman http://xiongman@gitlab.xiongman.com/fe/www.git www-xiongman
git clone -b xiongman http://xiongman@gitlab.zailouxia.com/fe/mds.git mds-xiongman
git clone -b xiongmanUpdate http://xiongman@gitlab.zailouxia.com/fe/mds.git mds-xiongmanUpdate
git clone -b xiongman http://xiongman@gitlab.zailouxia.com/fe/mds.git eams-xiongman
git clone http://xiongman@gitlab.zailouxia.com/fe/npm/be-scaffold.git
git clone -b xiongman http://xiongman@gitlab.zailouxia.com/fe/eam.git eam-xiongman
git pull
git add . && git commit -m "mds升级扫尾" && git push -u origin xiongman
git add . && git commit -m "mds1.6联调完毕" && git push -u origin xiongmanUpdate
git add . && git commit -m "mds17" && git push -u origin xiongman
git add . && git commit -m "备份20180821" && git push -u origin xiongmanEAMS
更新代码,频繁使用
git pull
git clone -b xiongman20180621 http://xiongman@gitlab.xiongman.com/fe/mds.git
@初次使用
初始化
git init
配置用户名
git config --global user.name xiongman
配置邮箱
git config --global user.email xiongman@zailouxia.com
新建分支
git branch xiongman
切换到新分支
git checkout xiongman
@频繁使用
添加所有的文件
git add .
添加备注
git commit -m "commit"
提交到仓库
git push -u origin xiongman
@其他
远程删除git服务器上的分支:
git push origin -d xiongman20180621
恢复到以前的版本
第一步: git log 查看之前的commit的id,找到想要还原的版本
第二步: git reset --hard 44bd896bb726be3d3815f1f25d738a9cd402a477 还原到之前的某个版本
第三步: git push -f origin master 强制push到远程
git切换仓库地址
git remote set-url origin URL
或者
git remote rm origin
git remote add origin URL
git remote -v查看现在仓库信息
git reset HEAD . 或者
git reset HEAD a.txt
'feat', 'fix', 'perf', 'style', 'docs', 'test', refactor 'build', 'ci', 'chore', 'revert', 'wip', 'workflow', 'types', 'release',