Git hook creation – You are on a branch yet to be born

So im setting up a git and following this guide

I get as far as this command:

  • how do I remove a remote branch when I get an error?
  • How do I include --no-pager in a Git alias?
  • Eclipse forget my Git password and username everytime after I do a push
  • git: how to move a branch's root two commits back
  • Which open-source git hosting software should I install on my company's intranet?
  • Programmatically tell difference between git-svn and git repos?
  • # GIT_WORK_TREE=/home3/trncprop/public_html/tpcapp git checkout -f

    And get the following error message

    fatal: You are on a branch yet to be born

    Does anyone know what I am doing wrong?

    Thanks in advance! Littleswany

  • I can't get Git to use Vim IN THE DOS SHELL — it says “cannot run sh”
  • How to revert a commit and create a new branch from those changes?
  • Unittesting Python code which uses subprocess.Popen
  • Modified files in a git branch are spilling over into another branch
  • pre-push git hook?
  • Django error on makemessages “should be run from the Django Git tree or your project or app tree”
  • One Solution collect form web for “Git hook creation – You are on a branch yet to be born”

    That command is supposed to be in a hook, not to be executed directly in website.git

    $ cat > hooks/post-receive
    GIT_WORK_TREE=/var/www/ git checkout -f
    $ chmod +x hooks/post-receive

    That means you need to create a website.git/hooks/post-receive file, with that command in it, and make it executable.

    That will allow you to push commits top that bare repo (website.git), which will trigger the post-receive hook, and will checkout the repo content into a different working tree.

    Git Baby is a git and github fan, let's start git clone.