git常用命令详解
2015-10-12 14:03
274 查看
克隆代码库
git clone
初始化代码库
git init
查看分支状态
git branch
比较代码不同
git diff
向代码库添加代码
git add
向代码库提交代码
git commit
把本地代码推到远程主机上
git push
git push 默认将当前分支推送到remote的同名分支上,如果只输入 git push origin 则会提示warning:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from ‘matching’ to ‘simple’. To squelch this message
and maintain the current behavior after the default changes, use:
git config –global push.default matching
To squelch this message and adopt the new behavior now, use:
git config –global push.default simple
When push.default is set to ‘matching’, git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative ‘simple’
behavior, which only pushes the current branch to the corresponding
remote branch that ‘git pull’ uses to update the current branch.
See ‘git help config’ and search for ‘push.default’ for further information.
(the ‘simple’ mode was introduced in Git 1.7.11. Use the similar mode
‘current’ instead of ‘simple’ if you sometimes use older versions of Git)
所以在使用git push 的时候,要么使用origin 并指明分支,要么不使用origin
更新远程主机代码到本地
git pull
合并代码
git merge
git rebase
git cherry-pick
查看日志
git log
git clone
初始化代码库
git init
查看分支状态
git branch
比较代码不同
git diff
向代码库添加代码
git add
向代码库提交代码
git commit
把本地代码推到远程主机上
git push
git push 默认将当前分支推送到remote的同名分支上,如果只输入 git push origin 则会提示warning:
warning: push.default is unset; its implicit value is changing in
Git 2.0 from ‘matching’ to ‘simple’. To squelch this message
and maintain the current behavior after the default changes, use:
git config –global push.default matching
To squelch this message and adopt the new behavior now, use:
git config –global push.default simple
When push.default is set to ‘matching’, git will push local branches
to the remote branches that already exist with the same name.
In Git 2.0, Git will default to the more conservative ‘simple’
behavior, which only pushes the current branch to the corresponding
remote branch that ‘git pull’ uses to update the current branch.
See ‘git help config’ and search for ‘push.default’ for further information.
(the ‘simple’ mode was introduced in Git 1.7.11. Use the similar mode
‘current’ instead of ‘simple’ if you sometimes use older versions of Git)
所以在使用git push 的时候,要么使用origin 并指明分支,要么不使用origin
更新远程主机代码到本地
git pull
合并代码
git merge
git rebase
git cherry-pick
查看日志
git log
相关文章推荐
- CentOS 6 安装Maven
- Percona XtraDB Cluster sum
- 判断字符串中第一位字符是否是ASCII字符( 0–127),ASCII字符占一个字节
- 爬爬爬之路:C语言(三) 入门篇3
- IOS9之后适配需要注意的问题
- iOS9适配系列教程
- 导航控制器生产,push,pop,root,index
- html5查看浏览器支持的格式
- 博客包含源代码共享一套,快来需要它
- spark maven编译
- DOM解析xml文件
- ThinkPHP框架概述
- android学习网站
- VS2010里的红色波浪线去掉
- 删除文件和文件夹
- Height Map高度图
- windows环境下安装Python Django
- JSF中获得HTTP SESSION和Request
- iOS开发——视频播放
- app timeline server