Git 基本操作
按照网上教程安装配置
Cd 到需要建立的本地仓库目录
git init
git clone 代码地址
完成 克隆项目
1 写新功能时在本地建立分支 不要再直接在master上操作
Cd 克隆的目录下
git checkout -b 分支名称 eg xfj/test
2查看分支状态
git status
3查看文件更改内容
git diff
4 提交更改
git add .
5添加更该内容提示
git commit -m “内容”
6 提交
git push
注意(首次建立分支后会提示To push the current branch and set the remote as upstream, use git push --set-upstream origin xfj/test
此时 输入命令 git push --set-upstream origin xfj/test
原因:本地分支关联远程分支 就是在远程上建立一个跟本地一样的分支)
在提交一次
现在远程的分支已经有跟本地一样的分支了,以后更改这个分支就好
如果该功能完成了需要将自己的分支合并到master 分支上
登录git 查看分支信息
1点击 branches查看所有分支
2点击自己的分支
3点击 compare
4在compare 界面 点击campare
5 点击 create merge request
6sublime marge request
。。。。未完