git 检查是否有commit到本地但还没push的代码
2017-04-29 15:30
369 查看
使用
[/code]命令可以得到以下结果
[/code]这就表示本地库还有没push的内容如果是以下结果,就表示本地全部都push了,同时表示本地还不是最新的,提示那里都提示你要去远程拿代码合并了
[/code]
总结:其实git的每条命令之后都有很多提示的,从中可以学到很多其他操作
来自为知笔记(Wiz)
git status
[/code]命令可以得到以下结果
$ git status
On branch dev_getTicketCnt
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
[/code]这就表示本地库还有没push的内容如果是以下结果,就表示本地全部都push了,同时表示本地还不是最新的,提示那里都提示你要去远程拿代码合并了
$ git status
On branch dev_activit_grabTicket
Your branch and 'origin/master' have diverged,
and have 1 and 4 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
nothing to commit, working directory clean
[/code]
总结:其实git的每条命令之后都有很多提示的,从中可以学到很多其他操作
来自为知笔记(Wiz)
相关文章推荐
- git的操作(拉代码到本地/commit到本地/pull/push到远程/新建分支/合并分支/)
- 记录一次操作git 的愚蠢行为(本地代码只 git add 过,没有 commit ,push 过,然后版本回退 导致本地代码丢失)
- 记录一次操作git 的愚蠢行为(本地代码只 git add 过,没有 commit ,push 过,然后版本回退 导致本地代码丢失)
- iOS:使用Github托管自己本地的项目代码方式一:(Xcode方式:开发工具Xcode配置Git,由Xcode-->Source Control-->Commit)
- git在一个分支上修改了代码但是不想commit到本地git库,需要切换一个分支去修改代码,这个时候也可以使用git stash
- Eclipse与GitHub的整合(一)——本地Git仓库中的代码push至GitHub
- [Git] 还原Git上commit,但是没有push代码
- Heroku空项目 Git本地Push代码错误 以及 Heroku Web启动错误
- gittortoise 提交 push 的时候指定某次commit的代码
- Git的纯命令操作,Install,Clone , Commit,Push,Pull,版本回退,撤销更新,分支的创建/切换/更新/提交/合并,代码冲突
- Git把本地代码push到oschina git仓库
- Git - 将本地的代码 push 到 GitHub
- git for c#, commit本地,push服务器
- git c#, commit本地,push服务器
- Git把本地commit不小心push到了服务器的处理办法
- git本地push代码报broken pipe
- 【指导】iOS代码静态检查 -- clang format (+ git pre-commit hook + jenkins)
- git 将本地代码push到github
- Android Studio使用GIt提交代码到本地仓库后没有Push,如何回退保存
- Git push本地代码到github出错