本地---->stage:暂存
配置全局用户-邮箱
git config --global user.name “jerry”
git config --global user.email “jerry@163.com”
git commmit "提交注释"
新仓库创建dev分支
git checkout -b dev
stage:暂存----->source
git push origin source 源端地址
更新内容 git pull source 源端地址
删除远程分支: git push origin :远程分支名
git push origin :Recsys_second
清除编译文件
git clean -df
删除本地分支
git branch -D Recsys_second
清空暂存区
git reset --hard 取消本次未提交修改
git reset --hard (logId: 回退到某个logid版本)
添加远程分支:
1.查看所有分支
jerry@hadoop:~/racoon/nongfu.ngx.log.analyser$ git branch -a
dev
* hotfix_redisconn
master
remotes/origin/dev
remotes/origin/hotfix_redisconn
remotes/origin/master
remotes/origin/prod
remotes/origin/stage
2.创建同名本地分支
git checkout hotfix_redisconn
3.拉去远程同名分支
git pull 直接会提示未添加跟踪信息
添加分支跟踪信息
git branch --set-upstream-to=origin/hotfix_redisconn hotfix_redisconn
拉取 git pull
1. 添加本地 tag
git tag -a V1.0 -m "2018-final-lithicjar"
git tag -a V1.0 -m "NongFu-20180504"
2.查看本地tag
git show V1.0
3.推送本地tag到远程
git push origin --tags
4.查看tag
git tag
git show V1.0
5.删除tag(有权限限制-可能无法删除)
git push tag -d V1.0
6.删除本地tag
git tag -d V1.0
7.推送本地修改到远程
git push origin :refs:/tags/V1.0
8.管理orgin (远程仓库地址)
删除origin: git remote remove origin
添加origin: git remote add origin http地址