zoukankan      html  css  js  c++  java
  • GitHub使用其他开发者的仓库

    GitHub使用其他开发者的仓库

    有 fork 子命令吗?

    fork 不在命令行上执行;也不存在 git fork 命令。你可以尝试运行以下命令:

    $ git fork

     

    修改克隆的仓库

     

     

     完成以下步骤,观察输出

    1、 克隆远程仓库

    git clone https://github.com/richardkalehoff/course-collaboration-travel-plans.git

     

    2、对本地内容进行一项修改

    3、git add .

          git commit 

    4、 添加远程仓库地址

     git remote add richardk_origin  https://github.com/richardkalehoff/course-collaboration-travel-plans.git

    5、使用git push 将你的更改推送回远程项目

      git push  richardk_origin master

    2、 创建include-richards-destinations 分支

          git checkout -b include-richards-destinations

    3、分三次修改index.html和app.css文件内容

    (第一次修改)     修改index.html和app.css修改内容如下,

                 修改完后运行git diff 确认修改内容。

                执行 git add .

                 执行  git commit -m "Add destination to Florida"

     

     

     

     

     

    将本地修改push到远程仓库

    push 当前分支到 远程仓库的 include-richards-destinations  分支,如果没有则建立一个新分支

           git push orgin include-richards-destinations

     

     这里产生了问题,,网络的原因使git push 无法正常进行,可以先退出来,再次进行应该可以。

     浏览远程仓库,会发现在branch选项多了一个include-richards-destinations 分支

     

     最后检查自己的修改

     

    小结

    fork 是一种在托管服务上完成的操作,如 GitHub。fork 仓库会创建与原始仓库完全相同的副本,并将该副本移动到你的帐户。你对 fork 的仓库拥有完全控制权。修改 fork 的仓库不会更改原始仓库。

  • 相关阅读:
    C# 函数式编程
    【python】 入门 搭建环境
    luogu P3978 [TJOI2015]概率论
    luogu P4778 Counting swaps
    luogu P2480 [SDOI2010]古代猪文
    luogu P3243 [HNOI2015]菜肴制作
    luogu P4744 [Wind Festival]Iron Man
    luogu P4448 [AHOI2018初中组]球球的排列
    luogu P1593 因子和
    luogu P1943 LocalMaxima_NOI导刊2009提高(1)
  • 原文地址:https://www.cnblogs.com/jingxinerwei/p/12487962.html
Copyright © 2011-2022 走看看