Troubleshooting git pull

I’ve set up a git repo via ssh on an Ubuntu box I’m using as a media center/backup server.

the steps I took were:

  • VS Code: .git folder/file hidden
  • How to connect OpenShift with a private BitBucket Repository
  • Git grep of past version
  • How to make “git branch” respect the “core.ignorecase” flag on Linux?
  • Git clone failed while unpacking - lack of space - how to recover without a full clone?
  • Is there a way to prevent accidental overwrite after git pull due to editor not updating automatically?
  • cd repos
    git init <repoName>
    cd <repoName>
    git config --bool core.bare true
    

    I’ve been able to successfully push and pull from my desktop and laptop via TortoiseGit, however a git pull via SSH returns:

    fatal: /usr/lib/git-core/gitpull cannot be used without a working tree. 
    

    I’m very new to terminal/ssh so any help would be greatly appreciated!

  • Apply gradle file from different repository
  • Git: “Not currently on any branch.” Is there an easy way to get back on a branch, while keeping the changes?
  • GitHub Api download zip or tarball link
  • Git fetch only one directory
  • git: 'flow' is not a git command. See 'git --help'
  • Creating a patch in git gives some headaches
  • 2 Solutions collect form web for “Troubleshooting git pull”

    You have to push to a bare repo. Pull will not work as it requires a working directory to merge to, which is what the error message that you see says.

    So setup a remote to the bare repo from the repo that you will be working on and push from that.

    PS: The ideal way to create a bare repo is to do git init --bare <reponame>

    A bare repository doesn’t have a working tree. git pull is functionally the same as a git fetch followed by a git merge, and to do a merge you have to have a working tree (in case there are conflicts you need to sort out).

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