本文仅涉及工作中常用的比较实用的技巧和方法,并不会涉及大而全的.?
所以关于如何安装git,或者git stash的用法请自行Google.
?
git branch master_local
?
注意:新的本地分支会自动复制当前的本地分支(包括commit未push的内容)
?
git checkout master
??
?
?
git checkout -b dev3333
?
?
git branch
?
?
git branch -a
?
?
?
git branch -d dev3333
?
?
?
?
git push origin --delete dev3333333_remote
?
?
前提:该文件不是新增文件,并且没有提交(commit)
?
git checkout -- test.sh git checkout -- readme.txt
?回滚多个文件:
?
?
git checkout HEAD -- prod.sh src/main/java/com/chanjet/gov/controller/LogViewController.java 1
?
?
前提:commit过,但是没有push
?
git reset --hard 0248d8341472ab9d80d4e43ce89876f502fc975c
?注意:后面的一串字符串从哪里获取呢??
?
参考下面的命令git log --pretty=oneline
?
或
git reset --hard HEAD^
?
?
?
git log --pretty=oneline
?
?
?
git -c core.quotepath=false push --progress --porcelain origin refs/heads/dev3333:dev3333333_remote --set-upstream
?简化版本:
?
?
git push origin refs/heads/dev3333:dev3333333_remote --set-upstream1
?说明:dev333是本地分支
?
?
git fetch origin --progress --prune
?
?
?
git branch --unset-upstream
?
?
参考:
http://blog.csdn.net/hw1287789687/article/details/51915068
原文:http://hw1287789687.iteye.com/blog/2311821