Click here to Skip to main content
15,888,286 members
Articles / STL
Technical Blog

Enabled Remove Development Environment

Rate me:
Please Sign up or sign in to vote.
0.00/5 (No votes)
13 Sep 2015CPOL 4.6K   1  
Enabled Remove Development Environment
  1. Install git server (with git-http-backend)
    /etc/httpd/conf.d/git.conf
    SetEnv GIT_PROJECT_ROOT /usr/share/git/
    SetEnv GIT_HTTP_EXPORT_ALL
    ScriptAlias /git/ /usr/libexec/git-core/git-http-backend/
    <Location /git/>
    AuthType Basic
    AuthName "Git Access"
    AuthUserFile /etc/httpd/conf.d/git-team.htpasswd
    Require valid-user
    </Location>

    Create username/password (with htpasswd)

    htpasswd -bc /etc/httpd/conf.d/git-team.htpasswd user pass

    Create git repo (under /usr/share/git/)

    git init –bare

    Make sure the git folder is accessible by apache:

    chown -R apache:apache /usr/share/git

    If using Windows as client, maybe you need to config:

    git config core.sharedRepository "all"
    git config receive.denyNonFastForwards True
  2. auto sync code to remote
    Clone a local repo on remote machine, and make it sync with master repo.
    cd /usr/share/web
    git clone /usr/share/git .
    … add all your web files and git submit …
    git push origin master

    Create a web handler to pull changes from master:

    Route::get(‘/pull’, function () {
    return system(‘cd /usr/share/nginx/web && git pull’);
    });
  3. Now I can enjoy writing code on my local machine, and push it to remote repo, then flush remote to take effect.
    git push origin master
    curl http://remote.machine/pull

The post Enabled remove development environment appeared first on Fei Zou's Blog.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
China China
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --