WebFaction
Community site: login faq
1
3

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 01 Mar '12, 17:32

sharkfin
27159
accept rate: 0%


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:

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

Create Website Record:

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:

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:

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:

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:

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:

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.

permanent link

answered 01 Mar '12, 20:23

ryans ♦♦
5.0k103860
accept rate: 43%

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

(12 Mar '12, 15:01) sharkfin

I now prefer the method described in this community post to ensure that all branches and tags are pushed correctly, and it's in a more convenient script form.

permanent link

answered 08 Oct '13, 21:31

ryans ♦♦
5.0k103860
accept rate: 43%

Your answer
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

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×111

question asked: 01 Mar '12, 17:32

question was seen: 7,998 times

last updated: 08 Oct '13, 21:31

                              
WEBFACTION
REACH US
SUPPORT
LEGAL
© COPYRIGHT 2003-2020 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM