Error with git configuration for web deployment

I’m attempting to configure Git for web deployment purposes, according to the directions provided here. However, I can only get as far as step two before things start to go awry.

Now the instructions say to input the following:

  • Where did this random git branch come from?
  • bitbucket hook for automatic update of source code from branch
  • Egit Refuses to accept id_rsa
  • Releasing & maintaining modules for nodejs
  • How can I merge a branch into master but continue working on the branch?
  • Git + Rails: How to restore files deleted with “git rm -r”?
  • git remote add myServer myUsername@ServerHostname:~/path/to/myRepo.git

    So I go ahead and plug in

    git remote add xxxyyy user@XXX.XXX.XX.XXX:/var/myRepo.git

    because I’ve created the repo–as instructed–outside my web directory. However, doing so gets me the following:

    fatal: Not a git repository (or any of the parent directories): .git

    So I’m not sure if I’m misinterpreting something in the command syntax or what, but I’m quite confused. As far as specifics are concerned, the environment I’m looking to deploy to is a VPS I’ve setup with Digital Ocean, and the environment I’m looking to develop in and deploy from is a Xubuntu virtualbox.

    EDIT: Problem has been solved with VonC’s most gracious assistance. Thanks to everyone who contributed!

  • How to reset 'schema.rb' to last git head?
  • git pull doesn't “download” changed files from origin
  • Push commits to another branch
  • squash more then two commits in sourcetree?
  • Version Control and Deploy Rails Project with cPanel
  • How to change author on git commit without re-fixing merge conflicts
  • One Solution collect form web for “Error with git configuration for web deployment”

    You need to be in your local repo (the one you want to be deployed) in order to make that command.

     cd /path/tpo/your/local/repo
     git remote add xxxyyy user@XXX.XXX.XX.XXX:/var/myRepo.git

    Then you will be able to push (and populate) the bare repo on the server with:

     git push -u myServer master

    (sill executed from your local repo folder)

    Note the -u: I like to establish a remote tracking branch relationship between your local master and your server repo master, especially when the remote repo is empty.
    See “Why do I need to explicitly push a new branch?”
    After that, a simple git push will be enough.

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