之前师兄在git上创建了一个新的branch,自己看到了,不过没怎么记得操作,后来师兄帮忙弄了一下,也是了解了一些大概
先交上代码,最近有点忙,随后有时间再添加注释,下面是dos窗口的一些命令。(主要是关于pull中的fetch跟merge,以及创建远程分支的track)
具体还是需要看廖雪峰的Git教程,很详细也很全,还有一个很不错的网址,可以参考
Microsoft Windows [版本 6.3.9600] (c) 2013 Microsoft Corporation。保留所有权利。C:\Users\bigMan.huizh>的: '的:' 不是内部或外部命令,也不是可运行的程序 或批处理文件。C:\Users\bigMan.huizh>d:D:\>cd www D:\WWW>cd reportv2D:\WWW\reportv2>git branch * masterD:\WWW\reportv2>git branch -a -v * master 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git fetch origin graph remote: Counting objects: 88, done. remote: Compressing objects: 100% (60/60), done. error: RPC failed; result=56, HTTP code = 200 ffatal: early EOF atal: The remote end hung up unexpectedly fatal: unpack-objects failedD:\WWW\reportv2>git fetch origin graph remote: Counting objects: 88, done. remote: Compressing objects: 100% (60/60), done. ^Cpacking objects: 54% (48/88) D:\WWW\reportv2>git branch -a -v * master 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git pull remote: Counting objects: 88, done. remote: Compressing objects: 100% (60/60), done. remote: Total 88 (delta 49), reused 61 (delta 22) Unpacking objects: 100% (88/88), done. From https://github.com/zhangbobell/reportv2* [new branch] graph -> origin/graph Already up-to-date.D:\WWW\reportv2>git branch * masterD:\WWW\reportv2>git branch -a -v * master 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/graph 9060e1f finish all the line chart with single lineremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git fetch origin graph From https://github.com/zhangbobell/reportv2* branch graph -> FETCH_HEADD:\WWW\reportv2>git branch -a -v * master 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/graph 9060e1f finish all the line chart with single lineremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git checkout --track origin/graph error: Your local changes to the following files would be overwritten by checkou t:application/core/MY_Model.php Please, commit your changes or stash them before you can switch branches. AbortingD:\WWW\reportv2>git status On branch master Your branch is up-to-date with 'origin/master'.Changes not staged for commit:(use "git add/rm <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)modified: application/controllers/management.phpmodified: application/core/MY_Model.phpdeleted: public/images/captcha/1416399365.4974.jpgmodified: public/js/management/project_edit.jsno changes added to commit (use "git add" and/or "git commit -a")D:\WWW\reportv2>git status application/controllers/management.php On branch master Your branch is up-to-date with 'origin/master'.Changes not staged for commit:(use "git add <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)modified: application/controllers/management.phpno changes added to commit (use "git add" and/or "git commit -a")D:\WWW\reportv2>git checkout -- application/controllers/management.phpD:\WWW\reportv2>git checkout -- public/js/management/project_edit.jsD:\WWW\reportv2>git checkout -- application/core/MY_Model.phpD:\WWW\reportv2>git status On branch master Your branch is up-to-date with 'origin/master'.Changes not staged for commit:(use "git add/rm <file>..." to update what will be committed)(use "git checkout -- <file>..." to discard changes in working directory)deleted: public/images/captcha/1416399365.4974.jpgno changes added to commit (use "git add" and/or "git commit -a")D:\WWW\reportv2>git branch * masterD:\WWW\reportv2>git branch -a -v * master 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/graph 9060e1f finish all the line chart with single lineremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git checkout --track origin/graph Branch graph set up to track remote branch graph from origin. Switched to a new branch 'graph'D:\WWW\reportv2>git branch -a -v * graph 9060e1f finish all the line chart with single linemaster 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/graph 9060e1f finish all the line chart with single lineremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>^A
第二段:dos界面下解决每次都是pull失败的情形
D:\WWW>cd reportv2D:\WWW\reportv2>ls
LICENSE README.md application index.php jt_usage.md public systemD:\WWW\reportv2>git status
On branch graph
Your branch is up-to-date with 'origin/graph'.nothing to commit, working directory cleanD:\WWW\reportv2>git branch -a -v
* graph bfa864e Updated the develop planmaster 210b0ae add MY_Model.phpremotes/origin/HEAD -> origin/masterremotes/origin/graph bfa864e Updated the develop planremotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git pull
Already up-to-date.D:\WWW\reportv2>