• 在github上参与开源项目贡献代码


    1 登录github, 点击自己感兴趣的repository的fork按钮,这样自己的github主页会有一个拷贝。

    2 在自己本地修改同时保持和原来的repository同步:

    git remote -v, 看看自己当前git repository的configure, origin 表示自己的repository

    要添加一个新的远程仓库,可以指定一个简单的名字,以便将来引用,运行 git remote add [shortname] [url]:git remote add upstream +原来repository的ssh链接

    git remote -v, 可以看自己当前目录有哪些远程仓库。 此时应该加上了upstream repository,也就是你所fork的repository。

    现在可以用字符串upstream 指代对应的仓库地址了。比如说,要抓取所有原来repository有的,但本地仓库没有的信息,可以运行 git fetch upstream:这样就把原来的repository的master branch拷贝到了本地。也可以用git fetch upstream branch1 把原来repository的branch1拷贝到本地。

    使用git merge upstream/master 将upstream和自己的master合并。

    用fetch不会影响自己本地的repository。用pull则相当于fetch了之后自动merge,可能会冲掉自己的代码。

    clone到本地进行修改,git add,commit,push。

    进入自己的github主页,点击最上面绿色的compare&review按钮。

    写点comment,提交。

    ref:

    https://guides.github.com/activities/forking/index.html

    在自己本地修改同时保持和原来的repository同步。

    https://help.github.com/articles/syncing-a-fork

    3.2分支管理很有用,整本书的翻译都有

    http://git-scm.com/book/zh

  • 相关阅读:
    centos7配置vsftpd
    vsftpd上传文件出现553 Could not create file错误解决方法
    mysql表引擎myisam改为innodb
    python字符串
    linux虚拟机设置本地yum源
    python3读取excel数据
    expect远程登录服务器并执行命令
    sed中支持变量的处理方法
    test
    test
  • 原文地址:https://www.cnblogs.com/huashiyiqike/p/3897947.html
Copyright © 2020-2023  润新知