65.9K
CodeProject is changing. Read more.
Home

Enabled Remove Development Environment

starIconemptyStarIconemptyStarIconemptyStarIconemptyStarIcon

1.00/5 (1 vote)

Sep 13, 2015

CPOL
viewsIcon

4676

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.