Git
GIT不仅仅是个版本控制系统,它也是个内容管理系统(CMS),工作管理系统等。
一、Git创建仓库
1.git init 初始化(当前目录作为Git仓库)
初始化后,在当前目录下会出现一个名为 .git 的目录,所有 Git 需要的数据和资源都存放在这个目录中。
2.git init newrepo(指定目录作为Git仓库)
二、克隆
1. git clone [url] (从现有仓库克隆)
三、分支
1. 创建分支: $ git branch (branchname)
2. 切换分支: $ git checkout (branchname)
3. 创建并切换分支: $ git checkout -b (branchname)
4. 删除分支:$ git branch -d (branchname)
- 强制删除分支: $ git branch -D mybranch
5. 合并分支
四、提交代码
1. $ git add *
2. $ git commit -m ’ '
3. $ git pull origin master(或分支名称)
4. $ git push -u origin master(或分支名称)