0
 $git log
 commit e9b08e2b428f9dd58aa0b792ebeb29da4270dfab (HEAD -> master)

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

 $git branch -a
 * master

 $git push -u origin master
 remote: Not Found
 fatal: repository 'https://github.com/Shell_learning/' not found

 $git remote add origin https://github.com/ekoopgj/Shell_learning
 fatal: remote origin already exists.
 #It is really strange that the repository already exists ,but I can't push my local update to remote branch.

I have created a repository in my github like below:

my github remote branch

So , please tell me what's the issue.

huang cheng
  • 393
  • 3
  • 15

2 Answers2

2

The URL you're currently using for your origin remote is not correct. The format for a GitHub repository URL should follow https://github.com/username/repository.git

Once you have defined a remote, you can't change it by using git remote add - you have to use git remote set-url.

This script should update your origin to the correct URL.

git remote set-url origin https://github.com/ekoopgj/Shell_learning.git
Edmund Dipple
  • 2,244
  • 17
  • 12
  • Or, given that things are configured incorrectly, one might also choose to go back to a known state by removing the `origin` remote and then re-adding the configuration correctly – Mark Adelsberger Dec 05 '17 at 14:47
1

you need to append .git to the repository address:

 git remote set-url origin https://github.com/ekoopgj/Shell_learning.git
pqnet
  • 6,070
  • 1
  • 30
  • 51