添加本地新分支:
git branch branch_local
将本地分支push到git服务器:
// 提交本地branch_local分支作为远程的branch_remote分支
git push origin branch_local:branch_remote
删除本地分支:
git branch -d branch_name
git branch -D branch_name //强制删除
删除远程分支:
git push origin :branch_remote
切换分支:
git checkout new_branch_name
查看与本地分支关联的远程分支:
查看git设置:
git config -l
修改提交的用户名和Email
git config --global user.name “your name"
git config --global user.email “you@example.com” //信息会保存在~/.gitconfig中
git branch branch_local
将本地分支push到git服务器:
// 提交本地branch_local分支作为远程的branch_remote分支
git push origin branch_local:branch_remote
删除本地分支:
git branch -d branch_name
git branch -D branch_name //强制删除
删除远程分支:
git push origin :branch_remote
切换分支:
git checkout new_branch_name
查看与本地分支关联的远程分支:
git branch -vv
列出本地tag
git tag
列出本地符合一定条件的tag
git tag -l "v1.0.*"
创建轻量标签(轻量标签是指向提交对象的引用)
git tag v1.0.0 [-light]
创建附注标签(附注标签则切换到标签是仓库中的一个独立对象)
git tag -a v1.0.0 -m "release 1.0.0"
切换到标签
git checkout tagname
查看服务器地址:
查看git设置:
git config -l
修改提交的用户名和Email
git config --global user.name “your name"
git config --global user.email “you@example.com” //信息会保存在~/.gitconfig中