Github : Does not appear to be a git repository

I need to create a new remote to my own github account. But when I try to enter below code it gives error.

pushpika@pushpika-CodeMe MINGW32 ~/codezeroplus-1.0 (master)
$ git fetch pushpika@work 
fatal: 'pushpika@work' 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.

What I need to do now?

Upvotes: 0

Views: 2922

Answers (2)

z atef
z atef

Reputation: 7679

From your question, I think you will need to go with a fresh start. At least to make sure that you have done the prerequs. Follow along and you will be all set to push , pull , branch , stash ....etc.

First do the initial set up to connect with the upstream.

git config --global user.name "YOUR NAME"


git config --global user.email "YOUR EMAIL ADDRESS"

You can read more here github DOC .

.com Then , you will need to go to gihub and create a new repository.

After creating a new projct , it will have Clone URL. Somethign like this"you will need to link you local with the remote" :

[email protected]:mike/blah.git

locally do the following :

CD=> navigate to the project folder
and run the following commands :

git init


git add .
# Adds the files in the local repository and stages 
#them for commit. To unstage a file, use 'git reset
#HEAD YOUR-FILE'.

git commit -m "First commit"
# Commits the tracked changes and prepares them to be pushed to a
#remote repository. To remove this commit and modify the file,
#use 'git reset --soft HEAD~1' and commit and add the file again.      


git remote add origin remote repository URL
# Sets the new remote



git push origin master
# pus to remote . 

There are other ways to do this.But , for now this is the easiest way until get the hang of git. .

Upvotes: 0

TimA
TimA

Reputation: 46

If you're trying to add a remote repository you need to perform a remote add first. The basic structure for the command is:

git remote add [shortname] [url]

If you've already done this step and you're still running into issues you should double check your shortname or url in your fetch. Use the git remote -v command to list the shortname and url pairing that Git has stored. For example,

$ git remote -v
origin  https://github.com/schacon/ticgit (fetch)
origin  https://github.com/schacon/ticgit (push)

There is a shorthand "origin" and its corresponding URL for push and fetch.

Check to make sure that your shorthand (I'm assuming that's how you're trying to use "pushpika@work") is correctly configured and/or use the full URL to access your repository.

PS. There are helpful instructions in the 2.5 Git Basics - Working with Remotes documentation. Check the "Adding Remote Repositories" section for more information.

Upvotes: 2

Related Questions