简体   繁体   中英

Can I combine my local Github repository with WAMP localhost folder?

I have C:\Users\my\Documents\GitHub for my local GitHub repository, and C:\wamp\www is where I work on projects locally with Wampserver.

What is the appropriate setup to work with them both? Should I tell Git to use 'www' as my local repository? Will that combine localhost with Github??

You could simply use the --work-tree or --git-dir argument of git in order to:

  • be in the Github folder, but mention that the working tree is www

     cd C:\\Users\\my\\Documents\\GitHub git --work-tree=C:\\wamp\\www status 
  • or be in the www folder and mention that the git repo is in the Github one

     cd C:\\wamp\\www status git --git-dir=C:\\Users\\my\\Documents\\GitHub\\.git 

The other approach is to have a git repo in both, and pulling Github from www .

    cd C:\wamp\www status
    git add remote origin C:\Users\my\Documents\GitHub
    git pull origin master

use php storm to do all the above. has a nice UI for the same

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM