Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8764263
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T15:59:16+00:00 2026-06-13T15:59:16+00:00

Is it possible to add a hook to a git repo that will automatically

  • 0

Is it possible to add a hook to a git repo that will automatically copy files from a directory in master to the root of a branch?

Here’s the reason:

I’d like to use GitHub pages to publish project documentation. Unfortunately, GitHub insists that the site content be in a branch named “gh_pages”. The trouble with this is that I have to switch branches whenever I want to write documentation, so I can’t code and write at the same time. Also, Eclipse freaks out when I switch to the gh_pages branch because there’s no .project file there, so the whole project closes.

A better way would be to store site content in a /gh_pages subdirectory in the master branch. It would be very cool if I could just edit a few markdown pages there, commit and push, and have to site be updated automagically.

Possible?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T15:59:18+00:00Added an answer on June 13, 2026 at 3:59 pm

    yes. you can add a folder within your project and have it as a submodule of itself. Point the submodule to the gh_pages branch. What’s more, is now you have a versioned link between the 2.

    Here are he steps:

    git submodule add docs git+ssh://github.com/yourid/yourproject.git
    git submodule init
    git submodule update
    cd docs
    git checkout gh_pages
    cd -
    git add -A
    git commit -m "added docs submodule"
    

    when you update your docs, execute this

    cd docs && git add -A && git push && cd - 
    

    I don’t bother scripting this. Pressing CTRL-R and type docs will bring it up quickly. Hit enter and you’re good to go.

    when you run git status you will see that there is a folder with changes docs. Add and commit as usual.

    When others want to keep in sync, you need to issue the command

    git submodule update
    

    to see whether the docs needs to be updated,

    git submodule
    

    will show you if the submodule is up to date or not initialized. If it’s up to date and initialized, you will see no marker before it’s listing. Otherwise, it will have a + or - in front of it depending if it’s behind or in front of the version that the top level repo has registered in the current commit.

    More info can be found in the progit.org/book chapter 6, section 6.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Is there any possible way to add swing into a shutdown hook (that is,
Is it possible to add messages to the built-in error console of Firefox from
Is it possible to add a menu item from within hook_menu() directly to the
Is it possible to add or remove slides in runtime using FlexSlider ?
Is it possible to add button click event by clicking design of axml? if
Is it possible to add the OR operator to php isset submit form code
Is it possible to add a table view on the cells of a table
Is it possible to add an Argument to an python argparse.ArgumentParser without it showing
Is it possible to add to PHP objects on the fly? Say I have
Is it possible to add an image(view) on top of a button (which as

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.