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 8917891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T05:36:22+00:00 2026-06-15T05:36:22+00:00

I am trying to set git up with http://danielmiessler.com/study/git/#website to manage my site. I

  • 0

I am trying to set git up with http://danielmiessler.com/study/git/#website to manage my site. I am working using the git gui in win7

I have gotten to the last step in the instructions: git push website

After pushing to the website, I was able to confirm that the object directory in bare directory ~/website.git is updated.

my hook is called ‘post_update’ it has the following contents

#!/bin/sh
echo
echo "**** Pushing data to Live Server.">>~/hi.txt
echo
export > ~.file1.txt
GIT_WORK_TREE=/home/***/public_html/b1a
export >> ~.file1.txt
git checkout -f

when I go to /public_html/b1a, it is an empty directory. Please note, I have changed the hooks directory and b1a to 777.

I can confirm that the post_update hook is firing, because I printing the environmental variables to file1.txt (as you can see above). In the file I see:

GIT_DIR="."

but GIT_WORK_TREE is not seen. without the ability to set this I am stuck.

I would appreciate any help,

Thanks in advance,

Bill

  • 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-15T05:36:24+00:00Added an answer on June 15, 2026 at 5:36 am

    EDIT: ok, so now I see your problem.

    This is the script you need:

    #!/bin/sh
    echo
    echo "**** Pushing data to Live Server.">>~/hi.txt
    echo
    GIT_WORK_TREE=/home/***/public_html/b1a git checkout -f
    

    I really don’t know why nor how this works, but it does.

    I don’t know either why you were redirecting the export output to those files – do you really need that?

    This script just check’s out the current HEAD of the repository to the GIT_WORK_TREE directory. That’s it. If you need anything else, please comment.


    I think you’re not exporting GIT_WORK_TREE variable.

    Try changing those lines so you really export that variable instead of just setting it:

    #!/bin/sh
    echo
    echo "**** Pushing data to Live Server.">>~/hi.txt
    echo
    export GIT_WORK_TREE=/home/***/public_html/b1a
    export > ~/.file1.txt
    git checkout -f
    

    The first export sets GIT_WORK_TREE value’s and marks it for export, the second one outputs all current exported variables to the file.

    I’m running this on Linux, but I hope it’s the same on git-bash…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to set git up with http://danielmiessler.com/study/git/#website to manage my site. I
I am trying to follow these instructions: http://source.android.com/source/downloading.html I have set up a fresh
I am trying to setup git on my Mac through this link ( http://help.github.com/mac-set-up-git/
I'm trying to use git behind a proxy and i have set up the
I'm trying to set up Git for staging my website so that I can
I'm new to Git, trying to get myself set up correctly. I have a
I'm trying to set up capistrano for pushing my project, using git as VCS.
I am trying to set up a Windows 2003 Server as a git server.
Trying to set up a self signed certificate, for our intranet's web services site.
I am trying to set up a git server with bunch of repositories. I

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.