Question

I'm trying to setup jekyll by following this setup. For that I created a public repository and under the same name on my computer cloned the project.

However once I try and push the code, it gives me following error -

fatal: 'aniruddhabarapatre.github.com' does not appear to be a git repository
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I tried doing Git setup in case something got overridden, but am unable to finish the process and it hangs on

git credential-osxkeychain
Was it helpful?

Solution

Make sure you are pushing to the right github repo.

Its url should be

https://github.com/aniruddhabarapatre/aniruddhabarapatre.github.com

If git remote -v doesn't show this, do a:

git remote set-url origin https://github.com/aniruddhabarapatre/aniruddhabarapatre.github.com

And try to push again.

For the credential issue, see this answer, or this one, or (for checking how git is installed) this answer.

OTHER TIPS

When you create a git repository add git ignore files, then it no more push unwanted files

Git global ignore

errors like this will occur when you try to push to a GitHub which you did not connected with the local repository you have in your machine. We can resolve this in a such way!

One: Delete your local repository and clone your GitHub project to your local machine($git clone ..url..) and now you can push any change directly to your GitHub account. If you do not want the original file from your local machine because you have some code on it you can move that to some where other than the directory you going to clone it. Then paste the content of your change inside newly cloned folder. Some time the issue/error may still persist so lets move to the second option.

Two: Here you mostly play with GitHub and follow this instruction since I did this many times. From your terminal

To initialize the local directory as a Git repository

  • $git init

Add the files to your new local repo

  • $git add .

commit the file

  • $git commit -m "any comment you want to say"

Add the URL for the remote(GitHub) repository

  • $git remote add origin ..url..

Set the new remote

  • $git remote -v

Push the change

  • $git push -u origin master

Now if you go to your GitHub repo you will see your change. While pushing the terminal might say pull first bla bla ... in that case you can force your push by saying

  • "$git push -f origin master"!!

Hopefully this will be helpful.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top