美文网首页
GIT的简单使用

GIT的简单使用

作者: 萧溪 | 来源:发表于2016-11-19 16:15 被阅读18次

注意:

1 新建的项目需要的操作

————>init ————>remote

2 添加了文件同步操作

————> add   ————>commit ————> Push

                                                                |

                                                                |(在你之前有人提交了新的代码)

                                                                ————>@3

3 在你之前有人提交了新的代码,你需要同步的操作

————>Pull ————>Push

                              |

                              |(发现Pull 下来有冲突)

                              ————>@4

4 发现Pull 下来有冲突

———>解决冲突———> commit————>Push

5 提交代码的步骤 @2


一些git  简单命令

git clone<项目地址>克隆一个项目

git remoterenameorigin oschina修改仓库名

gitremote add origin  仓库地址添加一个仓库

gitremote -v查看当前仓库对应的远程仓库地址

git init

git add .

git add *

git add -f * (强制添加)

git remote add origin  链接

git commit -m “描述”

git pull origin   分枝(master)

git push origin   分枝(master)

git log——查看日志

git branch   ——查看分枝

git branch分枝(分枝名字) ——创建分枝

git checkout分枝(分枝名字) ——切换分枝

相关文章

网友评论

      本文标题:GIT的简单使用

      本文链接:https://www.haomeiwen.com/subject/uuhepttx.html