login community faq
0
2

I'm currently not using Webfaction's Git app to manage my git repos, instead I am cloning and push/pull directly from Github into ~/webapps, which is working fine. Now that I want to use Trac+Git, I've set up WF Git, but I'm not familiar with the type of repo it is creating... looks the the actual git repo and not the project contents (HEAD, hooks, etc). How do I pull updates to this thing to keep it current?

asked Mar 01 '12 at 17:32

sharkfin's gravatar image

sharkfin
175


The Git repo on WebFaction is the same structure as the Git repo on (for example) Github. They're known as bare repositories because they only contain the contents of what is normally located in the ".git" directory. There is no "working tree", and you then interact with your WebFaction repository by cloning it and pushing updates to it.

Therefore, if you want to use the Git hosted on WebFaction, it will replace Github - you won't be using both to host the same repository at the same time. Let's go through an example of how you'll do the following:

  1. Setting up a Git application
  2. Initial copy of external repo to WebFaction
  3. Preparing the new WebFaction repo
  4. Using the WebFaction Repo
  5. Configuring automatic website updates (optional)

1.) Setting Up a Git Application

The Git application is set up like any other application, so it lives in $HOME/webapps/git and must be mounted to a website record to obtain HTTP/HTTPS access on a website URL.

For the sake of this example, we will use:

Create application:

1
2
3
WebFactoin username:    myuser
application name:       git
password (extra_info):  asdf

Create Website Record:

1
2
3
4
protocol:          https
domain:            git.mydomain.com
app:               git
URL Path:          /

This application will store its bare repositories in $HOME/webapps/git/repos/ and will be available online at https://git.mydomain.com/ with username "myuser" and password "asdf".

2.) Initial Copy of External Repo to WebFaction

Since your original repository was on Github, you need to move it over to WebFaction (which will replace Github). Do that via something like this:

1
2
cd $HOME/webapps/git/repos
git clone --bare https://github.com/myuser/myrepo.git myrepo.git

This will create a new bare git repository at $HOME/webapps/git/repos/myrepo.git. Notice the .git extension - that's important. This will be your new hosted repository, and the central location from which you push and pull.

At this point, you should be able to see your repository in the list of repositories at https://git.mydomain.com/

3.) Preparing the New WebFaction Repo

Next, enable git push over HTTP for your new repository as described in the Git Documentation:

1
2
3
cd $HOME/webapps/git/repos
cd myrepo.git
git config http.receivepack true

4.) Using the WebFaction Repo

  • ----- Cloning your repository locally in ~/webapps -----

First, create your empty application from the Control Panel. For this example, suppose we created a Django application named django which has a django project name myproj:

1
2
cd $HOME/webapps/htdocs
git clone $HOME/webapps/git/myrepo.git myproj

myproj is now a fully working repository linked to $HOME/webapps/git/myrepo.git, so you can pull and push as normal.

  • ----- Cloning your repository over HTTPS -----

You can also clone the repository from a remote location over HTTPS:

1
2
3
4
5
export GIT_SSL_NO_VERIFY=true
git clone https://myuser@git.mydomain.com/myrepo.git
cd myrepo/
git config http.postBuffer 524288000
git config http.sslVerify false

This repository has the ability to both pull and push over HTTP. Most other providers do not support push over HTTP.

  • ----- Cloning your repository over SSH -----

Traditional SSH-based access is available as well:

1
git clone myuser@git.mydomain.com:webapps/git/repos/myrepo.git

5.) Configuring Automatic Website Updates (optional)

Since you now have your git repository hosted on the WebFaction server, you now have the option of enabling automatic website updates whenever you push to your repository. This process is described here.

answered Mar 01 '12 at 20:23

ryans's gravatar image

ryans ♦♦
29361420

This explains it perfectly, thank you. The crucial part I was missing was the difference between bare and non-bare repos.

(Mar 12 '12 at 15:01) sharkfin sharkfin's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Tags:

×81

Asked: Mar 01 '12 at 17:32

Seen: 1,412 times

Last updated: Mar 12 '12 at 15:01

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited