如何参加开源软件的开发

本文以Github为例简单地介绍一下参加开源软件的开发的流程

准备工作
1. 下载并安装git软件。如要参加开源软件的开发,需要设定用户名和邮箱:
    git config --global user.name "用户名"
    git config --global user.email 邮箱地址
在这里,去掉上面的--global项可以用来设定个别的软件项目。查看现有设定时使用
   git config --list

2. 登录GitHub账号。可参见http://hillyuan.blogspot.jp/2013/04/tortoisegitgithub-repository.html

参加开源软件的开发
  选定打算参加的开源软件项目后
1. 建立个人fork
  登录进入GitHub,点击开源软件页面左上角的Fork图标即可建立你自用的repository。

注意: Fork功能是GitHub的自定义功能,因此类似功能在其他网站如gitlab的用法会有些不同。

2. 在本地机中Clone你的repository
    git clone https://github.com/youraccount/projectname.git
之后可以用
   ·git branch -a
确认你的文件夹
*master                                                        本地列表
 remote/origin/master                                  远程列表
 remote/originHEAD  -> origin/master
也可用git remote -v查看远程项目,
origin https://github.com/youraccount/projectname.git (fetch)
origin https://github.com/youraccount/projectname.git (push)
  在你个人的repository下做开发将会对原有的开源软件没有任何影响。如果你需要对原有开源进行跟踪并做出自己的贡献,还需要下面的设定

3. 登录远程项目
   git remote add upstream  https://github.com/original account/projectname.git
在这里upstream是你设定的远程地址名,upstream是一个被广泛接受的命名。
  之后再用git remote -v确认,你可以看到增加的远程列表
origin https://github.com/youraccount/projectname.git (fetch)
origin https://github.com/youraccount/projectname.git (push)
upstream https://github.com/original account/projectname.git (fetch)
upstream https://github.com/original account/projectname.git (push)

4. 取得upstream更新列表
   git fetch upstream

5. 确认你当前正处在本地master branch中
   git checkout master

6. 将upstream中的更新加载(merge)本地master branch中
  git merge upstream/master
如果你的修正与upstream有冲突,解消冲突。

 如果你希望的的修正能够反映到原有的开源软件
7.  登录进入GitHub,点击开源软件页面左中部的Pull request图标。填入必要的信息,然后等待原开发者的审查和更新


That'a all!

VS Code下cmake, c++编译,调试环境的构成步骤

1   下载必须extension      按[Ctrl+Shift+X]打开extension窗口,选择安装"C/C++", "CMake", "CMake Tools" 2   在VSCode下打开作业目录 ...