首页 > 代码库 > git 的分支使用

git 的分支使用

之前师兄在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 wwwD:\WWW>cd reportv2D:\WWW\reportv2>git branch* masterD:\WWW\reportv2>git branch -a -v* master                210b0ae add MY_Model.php  remotes/origin/HEAD   -> origin/master  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git fetch origin graphremote: Counting objects: 88, done.remote: Compressing objects: 100% (60/60), done.error: RPC failed; result=56, HTTP code = 200ffatal: early EOFatal: The remote end hung up unexpectedlyfatal: unpack-objects failedD:\WWW\reportv2>git fetch origin graphremote: 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.php  remotes/origin/HEAD   -> origin/master  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git pullremote: 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/graphAlready up-to-date.D:\WWW\reportv2>git branch* masterD:\WWW\reportv2>git branch -a -v* master                210b0ae add MY_Model.php  remotes/origin/HEAD   -> origin/master  remotes/origin/graph  9060e1f finish all the line chart with single line  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git fetch origin graphFrom https://github.com/zhangbobell/reportv2 * branch            graph      -> FETCH_HEADD:\WWW\reportv2>git branch -a -v* master                210b0ae add MY_Model.php  remotes/origin/HEAD   -> origin/master  remotes/origin/graph  9060e1f finish all the line chart with single line  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git checkout --track origin/grapherror: Your local changes to the following files would be overwritten by checkout:        application/core/MY_Model.phpPlease, commit your changes or stash them before you can switch branches.AbortingD:\WWW\reportv2>git statusOn branch masterYour 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.php        modified:   application/core/MY_Model.php        deleted:    public/images/captcha/1416399365.4974.jpg        modified:   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.phpOn branch masterYour 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 statusOn branch masterYour 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.php  remotes/origin/HEAD   -> origin/master  remotes/origin/graph  9060e1f finish all the line chart with single line  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>git checkout --track origin/graphBranch graph set up to track remote branch graph from origin.Switched to a new branch graphD:\WWW\reportv2>git branch -a -v* graph                 9060e1f finish all the line chart with single line  master                210b0ae add MY_Model.php  remotes/origin/HEAD   -> origin/master  remotes/origin/graph  9060e1f finish all the line chart with single line  remotes/origin/master 210b0ae add MY_Model.phpD:\WWW\reportv2>^A

 

 

git 的分支使用