1

I just created a new github account and then installed GitHub on my Windows 7.

I tried to use my comand line but when I type git says

git is not recognized as an internal or external command.

I checked the PATH and it is C:\Users\me\AppData\Local\GitHub\PortableGit_c2ba306e536fdf878271f7fe636a147ff3I can find a cmd folder in that path.

But, anyway, to avoid the hash I started using Git Shell. When I try to do git push I get

Warning: Permanently added 'github.com,192.30.252.128' (RSA) to the list of know
n hosts.
ERROR: Repository not found.
fatal: Could not read from remote repository.

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

I authenticated to gitHub. I also generated SSH keys but when I tried to add it to the SSH keys in my account in gitHub.com I got Key is already in use.

So, I have no clue what is going on. I did my best, please help me.

Thanks

wogsland
  • 9,106
  • 19
  • 57
  • 93
slevin
  • 4,166
  • 20
  • 69
  • 129

4 Answers4

1

Did you add the local folder into the git environment so as to enable it to know where to push it?

normally you would:

next steps depend on whether you have code you want to store in a fresh repo online or to pull a repo.

Pull is:

  • git pull origin master

push would be:

  • git add .
  • git commit -m "Original Commit"
  • git push origin master
Paul Dunlop
  • 327
  • 1
  • 5
  • I did `git clone https://github.com/me/myproj.git` instead of `git remote add origin https://github.com/user/repo.git` – slevin Jan 20 '16 at 23:27
  • Now if I do `git remote add origin https://github.com/me/myproj.git` I get `fatal: remote origin already exists.` – slevin Jan 20 '16 at 23:35
  • http://stackoverflow.com/questions/10904339/github-fatal-remote-origin-already-exists – Paul Dunlop Jan 21 '16 at 00:58
  • git clone by default add remote to your app.You don't need to add it manually after clone – sachin Jan 21 '16 at 05:23
0

git clone by default add remote to your app.You don't need to add it manually after clone

git remote add origin git_url 

Here origin is just work as a alias for url. You can name it whatever you want. This is used for mapping application to github.It works as a address. By default through git clone this address is added to your application. To check if remote is added to your application you can use

git remote -v

Also you can add multiple remote to single application ex. github and heroku both need different url to push code. In this

git remote add origin git_url

git remote add heroku (heroku_url or git_url)

When we add heroku and git to application and run

git remote -v 

It show two remote url Also If remote url starts with https refer to password authentication else ssh authentication.

sachin
  • 165
  • 1
  • 15
0

Thank you all for your time. What I did wasn first I uninstalled everything.

Then

Create a new account in gitgub.com

Download and install the github for desktop

On github desktop logout and login again with the username/password that you used at github.com (see here)

Go to github.com, to your accoun, copy your normal email (gmail) and paste it in github desktop to “configure git”, paste it over the “nonreply git mail” (see here)

Open Git Shell, hit

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

and

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

for configing username/email (see here)

Now works in Git Shell

slevin
  • 4,166
  • 20
  • 69
  • 129
0

i had the same problem, my advise is to type "git remote set-url origin https://github.com/username/reponame" before "git push origin master"

  • Avoid link only answers. Try to include why you think the linked resource answers the question in addition to the link in case the page contents change over time or the page becomes unreachable in future. – Fabulous Jul 04 '18 at 22:00