Create local git repository based on local repository based on github repository and keep it updated

后端 未结 5 2454
悲&欢浪女
悲&欢浪女 2021-02-20 11:42

I have some basic git knowledge but I\'m not sure how to accomplish this.

I am trying to clone (?) github WordPress starter theme underscores. The idea is to create a ba

5条回答
  •  说谎
    说谎 (楼主)
    2021-02-20 12:02

    Assuming you using a terminal, cd to the themes directory:

    cd [PROJECT]/wp-content/themes
    

    Now clone _s to your project:

    git clone git@github.com:Automattic/_s.git [THENE-NAME]
    

    After the clone ends you can start working with your new theme. cd to theme directory:

    cd [THENE-NAME]
    

    and create another remote for your repo.

    git remote add [NEW-RENOTE-NAME] [NEW-RENOTE-URL]
    

    From now on, you can push change into your private remote:

    git push [NEW-RENOTE-NAME] master
    

    and if you want to get updates from _s repo you can just:

    git pull origin master
    

    Good Luck!

提交回复
热议问题