首页 > 其他 > 详细

GIT命令

时间:2015-07-21 21:47:57      阅读:147      评论:0      收藏:0      [点我收藏+]

常用操作说明

# 本地仓库中存在的远程仓库列表
git remote
# 显示出远程仓库地址
git remote -v
# 根据远程仓库名, 获取其最新文件
git fetch origin
# 查看远程仓库的详细信息
git remote show origin
# 查看本地仓库的文件状态
git status
# 查看标签列表
git tag
# 查看本地仓库中的分支列表
git branch
# 创建新分支 testing
git branch testing
# 切换本地仓库到testing分支
git checkout testing
# 删除本地仓库分支 branch1
git branch -d branch1
# 强制删除本地仓库分支 testing
git branch -D testing
# 查看本地仓库各个branch对应的起始版本
git branch -v
# 添加文件到版本库
git add commons/pom.xml
# 提交
git commit -m "commit top pom.xml"
# 将本地仓库的 testing分支, push到远程仓库origin的branch1分支
git push origin testing:branch1
# 使用远程仓库origin的branch1分支, 在本地创建branch2分支, 并切换工作区间到这个分支上
git checkout -b branch2 origin/branch1

提交前的批量操作

# 批量删除
git rm folder -rf
# 批量添加 所有有变更及未跟踪的
git add -A

 

#

GIT命令

原文:http://www.cnblogs.com/milton/p/4665492.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!