git技巧
yum install git
1)配置git
git config --global user.name "xxx"
git config --global user.email xxx@qq.com
ssh-keygen -t rsa -C xxx@qq.com
2)创建分支
git checkout -b develop
//或者
git branch develop
git checkout develop
3)删除分支
// 删除标签
git push origin --delete v1.0
git branch -D v1.0
git tag -d v1.0
// 删除远程分支
git push origin --delete [branchname]
// 删除本地已合并的分支
git branch -d [branchname]
git branch -D [branchName]
4)还原git代码
git reset --hard origin/master
// 清除多余的内容
git clean -df
5)github加速 https://github.com/fhefh2015/Fast-GitHub
6)git打标签
git tag v1.0.0
git push origin v1.0.0
显示标签git tag, 删除标签git tag -d v1.0.0
7) git创建分支提交
git branch new-branch # 创建新分支
git checkout new-branch # 切换到新分支
git checkout -b develop # 或者合成一句
# 在新分支上进行代码修改
git add .
git commit -m "修改代码"
8) 删除gitrm -rf .git