I need to implement multiple bitbucket accounts on same machine.
I set user name and email locally but did not work
git: 'credential-[here show global user]' is not a git command. See 'git --help'.
remote: Unauthorized
fatal: Authentication failed for 'https://username#bitbucket.org/xyz/xyz.git/'
I resolve this issue by setting my remote url with my password
here you can check
git remote -v
origin https://USERNAME#github.com/REPOSITORY.git (fetch)
origin https://USERNAME#github.com/REPOSITORY.git (push)
now set your remote url like this
git remote set-url origin USERNAME:password#github.com/REPOSITORY.git
that it now on every command git never ask you about password
Related
I keep getting the error message below when I try to commit my changes to GitHub. Any solution on how to get around this? I'm still a novice when understanding how to push changes I've made to github from the new code I've added.
fatal: 'changes' 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.
Git is trying to push to the repository named changes. But returns a failed response either because the remote name doesn't exist or the path given is wrong. Here, the remote name doesn't even exist (that's the meaning of this error).
[ ] Check your `git remote -v` to see if a remote named `changes` exist
[ ] Configure `changes` as a remote address
First, check what you've configured remote to be
$ git remote -v
origin git#github.com:ashwink823/project.git (fetch)
origin git#github.com:ashwink823/project.git (push)
In the above example origin is the name of the remote we've configured git to fetch from or push to. If I try to push to a remote named changes it will return a fatal error because we haven't configured changes to be a remote address.
$ git push changes
fatal: 'changes' 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.
But if I add changes like
$ git remote add changes git#githubcom:clmno/project.git
# now, this will work
$ git push changes
I am not able to push to staging for heroku.
When I am doing git remote staging master I am getting
fatal: 'staging' does not appear to be a git repository
fatal: Could not read from remote repository.
Although I used to push to staging using the same command.
git remote -v
returns
origin git#bitbucket.abc/test.git (fetch)
origin git#bitbucket.org:abc/test.git (push)
I tried to add a git remote, but It created something else and when I did git push staging master, It created another url of the app instead of pushing for the earlier staging url.
I am not able to resolve this. Also I am the owner of the heroku app.
There is only one git repo configured here, and that is a bitbucket git repo. You need to add the heroku configuration too. See this link for reference.
Ultimately, run something like heroku git:remote -a heroku-app-name -r staging. Then you can do git push staging master and it'll push to the given app.
Problem when pushing app to github. This is what I entered into the command line. Hopefully it's just a small problem I can fix thanks.
git init
git add README.md
git commit -m "first commit"
git remote add origin git#github.com:travi5567/first_app.git
git push -u origin master
This is the error I get:
Traviss-MacBook-Pro:sample_app Travis$ git push -u origin master
Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
If you don't know how to use SSH keys or would rather not you can also use the https remote like so:
git remote add origin https://travis5567#github.com/travis5567/first_app.git
git push origin master
Password for travis5567: <enter your password>
# regular output from a git push
GitHub uses SSH keys to configure access to git repositories. If you are the owner you can push to the repo but you need to tell git your SSH key so they know who you are first.
It's all explained on the GitHub website - https://help.github.com/articles/generating-ssh-keys
I am trying to add remote gerrit but I am getting the error as :
fatal: remote gerrit already exists.
how to remove existing gerrit?
You didn't list what command was causing this error output, but I assume it was something like:
git remote add gerrit <url>
If you already have a remote named gerrit, you will get this error. You can see what remotes are in your repository with
git remote -v
To remove a remote, use
git remote rm <name>
name is 'gerrit' in your case.
A remote which name "gerrit" already exists. You can find it by:
git remote -v
So, remove this old remote:
git remote rm gerrit
Then add it again:
git remote add gerrit <url>
I have a rails app hosted on heroku and i want to push the code to github(Aready created a repo on there).I tried to follow the steps in this question .Since i already have a local repository and currently can push and pull from heroku i skipped step 2 and 3 .But when i do step 4
git remote add origin git#github.com:sparkz19/stark-journey-1727.git
It says
fatal: remote origin already exists.
And when i do git remote -v
It says
origin git#heroku.com:stark-journey-1727.git (fetch)
origin git#heroku.com:stark-journey-1727.git (push)
What do i need to do here?Thank you in advance.
Git complains because origin is already defined. If you still want to keep the heroku remote you could use git remote rename to save it as another remote:
git remote rename origin heroku
Reset the url with git remote set-url:
git remote set-url origin git#github.com:sparkz19/stark-journey-1727.git
Now you can push and pull to any you like:
git pull heroku master
git push origin master
Just give your new remote a different name than origin and you'll be good to go.