This is the first commit I'm adding to git. I ave initialized git inside my directory and am trying to remote add following this command:
git remote add origin git#github.com:pvenkat/Scribble-pad.git
But I receive a fatal error telling me remote origin already exists:
fatal: remote origin already exists
Does this mean I must remove the previous remote origin? If so how do i do that? If anyone knows whats wrong please help.
You probably already have the origin defined.
You can run,
git remote rm origin
Then,
git remote add origin git#github.com:pvenkat/Scribble-pad.git
You can update the URL of your existing remote with the following command:
git config remote.origin.url git#github.com:pvenkat/Scribble-pad.git
Related
I am trying to publish a branch from Github Desktop but I get this weird error: URL using bad/illegal format or missing URL. I have searched all around the internet and can't find a solution. Does anyone know how to fix it or why this error occurs?
Can you check the remote url of github repo? Please also check the remote name. By default it should be origin
It can be done as follows:
In your repo, run git remote -v and match the url returned with that of the "clone" url of your repo. If its different please update it to "clone" url of your repo locally.
And then try hitting:
git push origin <branch name>
I had this error because I added a bit wrong url locally to remote origin with
git remote add origin https://url:user/my-repo.git
Checked the remote origin locally and compared to cloning repo url
git remote show origin
fatal: unable to access 'https://...': URL using bad/illegal format or missing URL
I had to replace semicolon ':' with backslash '/' in front of username. Locally had to remove remote origin, then add back
git remote rm origin
git remote add origin https://url/user/my-repo.git
I had the same issue apparently you to use this command and it needs this format, I am using an access key:
$git remote set-url origin https://#github.com//.git
try that and see if that helps
I already made a repository in github as wordpress-template.
I created a .git repository locally, added some files there, and committed it.
Then I created a remote as origin and give it the url of the github repository as:
git remote add origin git#github.com:squalporeover/wordpress-template.git
Now I want to push my master branch to that repository. I ran the following command:
git push origin master
But it shows:
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
It looks like you added the SSH version of the remote URL. In order to use this you need to set-up Github with SSH.
Otherwise use the HTTPS version of the clone URL which will ask for your username and password:
You need to use ssh-keygen to generate an ssh key pair.
See: https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/
Duplicate found here: Git - Permission denied (publickey)
This worked for me:
Step 1- git remote rm origin
Step 2-select the http option in github
step 3- run the following command again
git remote add origin https://github.com/yourdirectory/link.git
git branch -M main
git push -u origin main
I have the repo here Link to the repo
I cloned it and did some changes but when I try to push it.
It gives me the following error:
$ git push origin HEAD:refs/for/master
Username for 'https://review.gerrithub.io': ardyflora
Password for 'https://ardyflora#review.gerrithub.io':
fatal: Authentication failed for
'https://review.gerrithub.io/ardyflora/virginPulseAuto/'
I have even added the ssh key. Any pointer or help will be appreciated :)
Authentication failure for HTTPS. Better you can take a try with SSH.
Copy the URL for SSH of your repository using a browser and update your local origin.
$ git remote set-url origin <ssh-clone-url>
$ git push origin HEAD:refs/for/master
I'm trying to push something to github and I'm getting this error;
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git push -u origin master
fatal: repository 'https://github.com/BitMechanic/Stanford-CS106b/Huffman.git/' not found
Then when I check I get this;
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote add origin https://github.com/BitMechanic/Stanford-CS106b/Huffman
fatal: remote origin already exists.
Robbies-MacBook-Pro:assn-6-huffman-mac user$ git remote -v
origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
(fetch)
origin https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
(push)
Anyone know what I'm doing wrong?
The proper url to use (for cloning and then pushing through origin) is
https://github.com/BitMechanic/Stanford-CS106b.git
not:
https://github.com/BitMechanic/Stanford-CS106b/Huffman.git
Stanford-CS106b is a repo, listed in the BitMechanic's repo page of d. Stanford-CS106b/Huffman is not.
To fix this, see git remote commands:
git remote rm origin
git remote add origin https://github.com/BitMechanic/Stanford-CS106b.git
or, simpler:
git remote set-url origin https://github.com/BitMechanic/Stanford-CS106b.git
Can you paste the
$cat .git/config
output here for reference.
Sometimes it is better to remove the remotes that are misbehaving from there and re-add it using the git remote add command again.
I've created an account for github,and set up ssh at home and at my workplace. now I just want to renew and add files so that I do some operation like this:
jty#CVICSE-0E662498 ~/front-end-learn (master)
$ git remote add origin git#github.com:jtyjty99999/front-end-learn.git
jty#CVICSE-0E662498 ~/front-end-learn (master)
$ git push - u origin master
ssh:github.com:noaddress associated with name
fatal: The remote end hung up unexpectedly
I failed T_T. At my workplace I used proxy to connect to Internet, does it matter? How can I solve this problem? thanks everyone cordially.
I think you are inputting the command wrong, I believe it is supposed to be this
git push -u origin master
(no space after the '-')
and you can double check the proper address by using
git remote -v
edit: you also have to use the commands commit and add to actually tell git what to push
here is more info