网站制作学习网经验与学习→正文:git 创建分支
字体:

git 创建分支

经验与学习 2015/12/21 23:29:07  点击:不统计

原载于:原文章%77w%77%2Ef%6F%72%61%73%70%2E%63n
 git 创建分支  

 
git,创建,分支,branch,master,test,Helloword
 
 
git 创建分支很简单的
1.先看git当前下有什么分支
>git branch
* master  
 
星*表示在当前分支上面。
 
2. git创建分支 test
>git branch test //回车创建分支test完毕
然后
>git branch
* master
  test
  
3.git切换分支
>git checkout test //回车即切换到test分支
>git branch
  master
* test
我们可以看到 目前已经在test分支上面了。
4.在test创建一个文件 Helloword.txt 内容为 字符串forasp.cn
>touch Helloword.txt
>echo "forasp.cn" >Helloword.txt
>git status //可以看到当前Helloword.txt
>git add . --all //将文件添加到当前分支
>git commit -m 'add Helloword.txt'
 
5. 然后我们切换到不同分支即可看到 不同分支下的不同文件。
 

·上一篇:nginx child 26503 exited with code 0 after x seconds from start >>    ·下一篇:mysql-5.7.10 linux 安装教程 >>
推荐文章
最新文章