I am following the instructions given here to create a Git repository. All went well until the last line:
$ git push -u origin master
Your config file does not include any references to "origin" remote. That section looks like this:
[remote "origin"]
url = git@foo.com:repository.git
fetch = +refs/heads/*:refs/remotes/origin/*
You need to add the remote using git remote add
before you can use it.
Here are the instructions from github:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/tqisjim/google-oauth.git
git push -u origin master
Here's what actually worked:
touch README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/tqisjim/google-oauth.git
git clone origin master
After cloning, then the push command succeeds by prompting for a username and password
Here is how I resolved this issue
Go to the remote repository on Github and copy the project's repository url.
On git bash type: git remote add origin the remote repository url goes here
I had this problem cause i had already origin remote defined locally. So just change "origin" into another name:
git remote add originNew https://github.com/UAwebM...
git push -u originNew
or u can remove your local origin. to check your remote name type:
git remote
to remove remote - log in your clone repository and type:
git remote remove origin(depending on your remote's name)
When you create a repository in bitbucket.org, it gives you instructions on how to set up your local directory. Chances are, you just forgot to run the code:
git remote add origin https://username@bitbucket.org/username/reponame.git
If you are on HTTPS do this-
git remote add origin URL_TO_YOUR_REPO