再所有操作之前都需要先拉最新代码
1 从服务器clone代码
git clone git@172.172.172.172:member
2 拉最新代码
git pull --rebase
3 提交代码
git add .
git commit -m "[dalin] fix bug 0322"
git push origin HEAD
4 打TAG
git tag TAG_20121122
git push origin TAG_20121122
5 拉分支
git pull --rebase
git branch NewBranchName
git push -u origin NewBranchName (提交)
6 Merge分支代码
git pull --rebase
git checkout master
git merge STG
git push origin HEAD
7 删除分支
#删除本地分支:
git branch -D unUsedBranchName
#删除远程分支
git push origin :dev20121221
#如果删除时报error: unable to push to unqualified destination
#尝试以下命令
git branch -r -d origin/my_remote_branch
8 删除远程TAG
git push origin :refs/tags/20121221_01
9 显示TAG/Branch信息
git tag -l(显示所有tag)
git branch -l(显示所有branch)
git show tagName
10 显示TAG/Branch之间的改动文件
git diff --name-status newTag..oldTag
11 显示远程的tag所有列表
git ls-remote origin refs/tags
12 显示远程特定的tag列表
git ls-remote origin reg*
13 本地提交所有的tag
git push origin ref/tags/*
14 当有tag无法通过git pull命令获取时,请尝试使用下面的命令
git fetch --tags
1 从服务器clone代码
git clone git@172.172.172.172:member
2 拉最新代码
git pull --rebase
3 提交代码
git add .
git commit -m "[dalin] fix bug 0322"
git push origin HEAD
4 打TAG
git tag TAG_20121122
git push origin TAG_20121122
5 拉分支
git pull --rebase
git branch NewBranchName
git push -u origin NewBranchName (提交)
6 Merge分支代码
git pull --rebase
git checkout master
git merge STG
git push origin HEAD
7 删除分支
#删除本地分支:
git branch -D unUsedBranchName
#删除远程分支
git push origin :dev20121221
#如果删除时报error: unable to push to unqualified destination
#尝试以下命令
git branch -r -d origin/my_remote_branch
8 删除远程TAG
git push origin :refs/tags/20121221_01
9 显示TAG/Branch信息
git tag -l(显示所有tag)
git branch -l(显示所有branch)
git show tagName
10 显示TAG/Branch之间的改动文件
git diff --name-status newTag..oldTag
11 显示远程的tag所有列表
git ls-remote origin refs/tags
12 显示远程特定的tag列表
git ls-remote origin reg*
13 本地提交所有的tag
git push origin ref/tags/*
14 当有tag无法通过git pull命令获取时,请尝试使用下面的命令
git fetch --tags