Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7752035
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:41:55+00:00 2026-06-01T11:41:55+00:00

I am trying to wrap my head around Git and deploying websites with (or

  • 0

I am trying to wrap my head around Git and deploying websites with (or without) it. I have been Googling and searching and reading, but can’t find an answer to my specific case or concerns. I am still in the planning stages of doing this, but would like to get it right from the start and find a work flow that works for me. I will try to explain the situation as clear as possible:

I have a remote VPS that runs my live website on http://www.example.com and the development version on dev.example.com (they reside in /var/www/example/htdocs/ and /var/www/example/subdomains/dev/).

Development is run from a bare repository in /opt/git/example.git/. There is a master and development branch in the bare repo. Me and the other developer both have a clone of this repository on our local machine. We pull from the development branch and work from there. The idea is that dev.example.com has up to date code from the development branch and once that is properly tested, we merge into master, add a tag and update example.com (basically, this git flow).

The first approach I found on the Git IRC channel uses hooks to update repositories, but this feels very limitting and sometimes also unwanted, I’d like to run a command on the server myself after pushing, that updates the development environment. Another command (or shell script) would update the live site from the master branch after development has been merged). I also found Capistrano, but that seems a little over my head at the moment.

While reading, I found a lot of people suggesting to create two more clones on the remote: one for the live site and one for the development site, pulling in branches when necessary. This however also leaves the version control files accessible via the web, which is something I don’t want. Ideally, I want a “clean” copy without any git files or folders.

I also found an approach using git archive, but running git archive from my bare repository only allows me to archive the master branch. I do this using the command git archive --format=tar HEAD | (cd /var/www/example/htdocs/ && tar xf -) in /opt/git/example.git/.

I feel like the git archive approach brings me closest to an answer, but I am limited by my lack of Git knowledge. Can I alter the command to use a branch instead of HEAD (when I tried using origin/master instead of HEAD, I got an error)? Is there anyone who can point me in the right direction?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:41:56+00:00Added an answer on June 1, 2026 at 11:41 am

    You can use any tree-ish (any branch, tag, sha1 hash etc) as an argument to git archive. You can’t use origin/master since you are in the bare repo and it doesn’t have an origin. You need to use the local branch names, e.g.

    git archive --format=tar develop
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I trying to wrap my head around setTimeout , but I can't get it
I'm trying to wrap my head around asp.net. I have a background as a
Trying to wrap my head around the apple design scheme. I have a UIViewController
I'm trying to wrap my head around this, but I seem to go in
I'm trying to wrap my head around multiple inheritance in python. Suppose I have
I've been trying to wrap my head around unit testing and I'm trying to
I'm trying to wrap my head around linq -> nhib I have a simple
I'm trying to wrap my head around navigation rules in JSF2.0. If I have
I'm trying to wrap my head around the async api, without much success. I
I'm trying to wrap my head around mongoose, but I'm having a hard time

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.