WebFaction
Community site: login faq

Hi,

I have a gitweb installation in ~/webapps/vcs and my repositories are located in the repos subfolder. But I was wondering, let's say we have a mysite.git repo (bare) in ~/webapps/vcs/repos/mysite.git. What is the best way to checkout de latest source code to the specific website, in for example ~/webapps/mysite? If course I could clone the repo, but then it exists twice and since I only need the latest source code in the mysite directory, it seems not very efficient to me.

Another idea is to tar the source code in the git repo and untar in the mysite directory, but if just one file has changed it's not necessary to replace every file.

So, what is the best way?

asked 25 Aug '12, 18:45

Peter
1316
accept rate: 0%


This is certainly possible, and actually there are many methods. This related community post describes my favorite solution. It allows you to:

  1. not have any .git directory in your application root,
  2. automatically updates the code whenever you push changes, and
  3. you can also have "master" and "develop" branches, where each branch would push to a different application (so you can have production and a staging apps developed together. Use Git Flow if you do this.)

Hope that helps!

permanent link

answered 25 Aug '12, 19:23

ryans ♦♦
5.0k93160
accept rate: 43%

edited 25 Aug '12, 19:24

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
×2

question asked: 25 Aug '12, 18:45

question was seen: 2,264 times

last updated: 25 Aug '12, 19:24

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 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