版本管理——gitee和git的使用

1、gitee和git能解决的问题git

咱们开发小组,有三位同窗,怎么共享代码?bash

我更新代码后,怎么传递给另外两位同窗?spa

我和别人同时修改了一个文件,怎么办?3d

2、准备blog

注册gitee:https://gitee.com/开发

注意事项:给我的空间地址取个好名字it

下载git:https://git-scm.com/downloadsio

安装git:出现一堆选项,我全选了默认;ast

建议:将line ending conversion 改成“checkout as is,commit as is”,不要让git帮你改email

3、建gitee仓库

必填的只有仓库名称和路径,其余的默认就好

仓库地址构成——https://gitee.com/我的空间地址/仓库名

4、git配置

新建个文件夹,右键,选择“git bash here”  

用户名:git config --global user.name "xiaoming"

邮箱:git config --global user.email "xiaoming@example.com"

5、clone/push/pull 操做

clone:将码云上的仓库复制一份到本地;

push:将本地修改后的代码推送上码云;

pull:将别人推送的代码拉取到本地;

clone:

git clone https://gitee.com/我的空间/仓库名

 add->commit->push:

git add .

git commit [-m "修改说明”]

git push origin master

pull:

git pull origin master

 

gitee工做台的动态更新

6、其余

上传代码片断

fork:看到想参与的gitee项目,fork到本身的码云仓库中

watch:watch项目进展,不参与项目

pull request:向审核人员发送pull request,等待经过

(讲道理,为何不叫push request?)

可能的答案:https://cloud.tencent.com/developer/article/1348651

7、回答开头的问题

代码共享:从gitee仓库中clone或pull

代码更新:从本地pull到gitee仓库

冲突管理:push时,若是有冲突(好比文件已经被别人修改过了),建议你从新pull一次仓库

相关文章
相关标签/搜索