`
snoopy7713
  • 浏览: 1125956 次
  • 性别: Icon_minigender_2
  • 来自: 火星郊区
博客专栏
Group-logo
OSGi
浏览量:0
社区版块
存档分类
最新评论

Git 指令

    博客分类:
  • Git
阅读更多

技巧:
git bash shell:
1.在输入git命令是可以敲2次Tab键,会看到列出所有匹配的命令建议。
2.自定义命令名称。git config –global alias.ci commit .现在,要输入git commit只需输入git ci即可。

当前目录初始化
git init

添加文件跟踪
git add 文件名

从仓库克隆
git clone 地址

检查当前文件状态
git status

忽略某些文件
新建.gitignore文件
*.log

查看版本差异
git diff

提交更新
git commit

移除文件
git rm 文件名

移动文件
git mv file_from file_to

查看历史
git log

查看远程仓库
git remote

从远程仓库抓取数据
git fetch [remote-name]

推送到远程仓库
git push [remote-name]

查看远程仓库信息
git remote show [remote-name]

远程仓库重命名
git remote rename oldname newname

远程仓库删除
git remote rm remote-name

列显已有标签
git tag

创建分支
git branch 分支名

切换分支
git checkout 分支名

删除分支
git branch -d 分支名

合并分支
git merge 分支名

列出分支
git branch

分支衍合
git rebase

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics