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 to setup Github SSH key on second computer
  • Is it possible to Git merge / push using Jenkins pipeline
  • Does another version control system have a ClearCase-like filesystem access to file versions?
  • setting up git in a private server, it asks for git password
  • How to move the changes from one branch to another branch git?
  • SourceTree on Windows: How to connect to SSH?
  • # 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

  • Make a shell script to update 3 git repos
  • How to view the changes in a single file in GitHub?
  • git problem : fatal: Unable to write new index file
  • Exact git command line equivalents to the “Pull Request” and “Fork Repo” buttons in Github
  • How to git stash changes in current folder
  • Git Commit works with XCode beta but not with normal version
  • 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.