Git常用命令
拉取代码:
git pull
推本地代码上去:
1、git status
2、git add [filename1] [filename2]
3、git commit [filename1] -m “提交信息说明”
4、git push
回退
1、退回至缓存区的coding回退
git reset [filename1]
2、会退到制定版本
git reset –hard 版本号(版本号为commit后的)
看提交日志:
git log
git log –oneline
分支
1、查看分支
git branch
2、创建分支
git branch 分支名
3、切花分支
git checkout 分支名
git checkout -b 分支名(创建并切换分支)
4、合并某分支到当前分支
git merge 分支名
5、删除分支
git branch -d 分支名(强行删除 -D)
git commit -m "[T]-[N/A]-add request method code"
git submodule init
git submodule update
然后cd cmbcar-b-contracts
然后git checkout master 将contractcheck到master
git stash
git stash pop
git push --no-verify (本地跑完,不用test)
git add . 提交所有
改完之后
git stash
git pull --rebase
git stash pop
git add .
git commit -m "[T]-[N/A]-add request method code"
git push
1. 新建分支 xxx
2. git pull (目录下 命令行将线上分支拉倒本地)
3. git checkout xxx (切换到到该分支 )
(可使用 git status 查看目前处于哪一个分支)
4. 然后 coding...
5. git add . (有个英文状态的句号!!!)
6.git commit -m 'qw4awe' (提交,-m ''提示信息)
7. git push
8. git checkout master (回到主分支)
9. git merge xxx (将该分支合并到主分支上)
10. git push