0

I recently came across the octopress blogging platform and followed the installation instructions. I am hosting it on github using github pages. I created a repository and successfully managed to make an initial commit. My problem came when I tried to make another commit and this is the message I got:

Immanuels-MacBook-Pro:octopress manuweg$ git add .
Immanuels-MacBook-Pro:octopress manuweg$ git commit -m "Changed origin url"
[source e0fff54] Changed origin url
1 files changed, 1 insertions(+), 1 deletions(-)
Immanuels-MacBook-Pro:octopress manuweg$ git push origin source
ERROR: Repository invalid.
fatal: The remote end hung up unexpectedly

This is the config in my .git/config file

[remote "origin"]
    url = git@github.com:manuweg/manuweg.github.com.git
    fetch = +refs/heads/*:refs/remotes/origin/*

When I do

git config --get-regexp '^(remote|branch)\.'

I get

remote.octopress.url git://github.com/imathis/octopress.git
remote.octopress.fetch +refs/heads/*:refs/remotes/octopress/*
branch.source.remote origin
branch.source.merge refs/heads/master
remote.origin.url git@github.com:manuweg/manuweg.github.com.git
emote.origin.fetch +refs/heads/*:refs/remotes/origin/*

As you can see there seems to be a spelling mistake on the last line

emote.origin.fetch +refs/heads/*:refs/remotes/origin/*

Which I assume should read:

remote.origin.fetch +refs/heads/*:refs/remotes/origin/*

The remote origin url is correct and worked for the initial commit. Any ideas why I am getting this error?

Manu
  • 569
  • 2
  • 8
  • 21
  • So I solved this problem by creating another origin with exactly the same details as the first origin: git remote add origin2 git@github.com:manuweg/manuweg.github.com.git – Manu Jun 28 '12 at 09:24
  • 1
    You should post it as an answer if it fixed your problem. – vergenzt Jun 28 '12 at 12:27

3 Answers3

2

So I solved this problem by creating another origin with exactly the same details as the first origin:

git remote add origin2 git@github.com:manuweg/manuweg.github.com.git
CharlesB
  • 86,532
  • 28
  • 194
  • 218
Manu
  • 569
  • 2
  • 8
  • 21
2

I solved the error by deleting the origin and re-adding it. hope this helps. you should replace and with your information.

git remote rm origin
git remote add origin git@github.com:<username>/<applicationname>.git
Yeonho
  • 3,629
  • 4
  • 39
  • 61
  • Nice one for removing origin. I got a bit stumped on that but removing it and creating a fresh one is the best solution rather than adding another one. – Manu Sep 24 '12 at 21:24
0

In http://octopress.org/docs/deploying/github/

Use this if you want to host a blog from http://username.github.com (though you can also use custom domains).

Create a new Github repository and name the repository with your user name or organization name username.github.com or organization.github.com.

repo name should be username.github.com, not username.

hotpro
  • 336
  • 2
  • 3