Category Archives: WordPress

WordPress themes and plugins development with Git

  1. Fork wordpress/WordPress to yalenuscollege/WordPress
  2. Clone Yale-NUS WordPress fork
    fork and upstream
  3. Clone origin to local working folder
    $ cd ~/Sites/
    $ git clone https://github.com/yalenuscollege/WordPress.git wordpress
  4. Add upstream repository to wordpress
    $ git remote add upstream https://github.com/wordpress/WordPress.git
  5. Verify remote repositories
    $ git remote -v
    origin https://github.com/yalenuscollege/WordPress.git (fetch)
    origin https://github.com/yalenuscollege/WordPress.git (push)
    upstream https://github.com/wordpress/WordPress.git (fetch)
    upstream https://github.com/wordpress/WordPress.git (push)
  6. Add yalenus theme as a submodule
    $ cd ~/Sites/wordpress/wp-content/themes/
    $ git submodule add https://github.com/WallaceTan/YNC-student-feedback.git yalenus-courses-child
  7. Change origin of submodule
    $ cd ~/Sites/wordpress/wp-content/themes/yalenus-courses-child/
    $ git remote set-url origin https://github.com/yalenuscollege/wp-themes-yalenus-courses-child.git
    $ git push origin master
  8. cd ~/Sites/wordpress/wp-content/themes/
    # Change to wordpress themes directory
    
    git submodule add https://github.com/yalenuscollege/themes-yalenus.git yalenus
    # Add yalenus theme as a submodule