Search code examples
gitpullcorrupt

Git after wiping hard drive


I have a project hosted with git. I just recently had to reinstall ubuntu, and am in the process of getting everything set up again. I was able to log back into git and get all of my files back, but now am having some trouble.

When I try to pull, using the same syntax as I would normally, I get this:

$ git pull Peter master
fatal: 'Peter' does not appear to be a git repository
fatal: The remote end hung up unexpectedly

My git config looks like this:

$ git config --list
user.name=Peter
user.email=****@***.com
branch.master.remote=Peter
branch.master.merge=refs/heads/master

Git branch looks like this:

$ git branch -a
* master
  remotes/Peter/HEAD -> Peter/master
  remotes/Peter/master

Does anyone have any ideas? I'd be happy to provide whatever other information is necessary. Thank you


Solution

  • You need to have a remote defined in your config, something like this :

    [remote "Peter"]
        url = ssh:/xxxx/git/ccc.git
        fetch = +refs/heads/*:refs/remotes/peter/*
    

    Use git remote add Peter xxxx to add it