Always coming late to answer anything, it may be possible that you have more than one ssh keys and if not specified git will try to use id_rsa
but if you need a different one you could use
git clone [email protected]:userName/projectName.git --config core.sshCommand="ssh -i ~/location/to/private_ssh_key"
This way it will apply this config and use a key different than id_rsa
before actually fetching any data from the git repository.
subsequent fetch
or push
will use the specified key to authenticate for the cloned repository.
Hope this is helpful to anyone.
Related Posts:
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- How do I clone a specific Git branch? [duplicate]
- Git: Message ‘src refspec master does not match any’ when pushing commits in Git
- Clone A Private Repository (Github)
- How to clone a specific Git tag
- How do I clone a single branch in Git?
- How to clone git repository with specific revision/changeset?
- How do you clone a Git repository into a specific folder?
- Git clone verbose output?
- How to get Git to clone into current directory
- How to get Git to clone into current directory
- How do I clone a subdirectory only of a Git repository?
- Git push requires username and password
- How do I check out a remote Git branch?
- What does ‘–set-upstream’ do?
- What does ‘–set-upstream’ do?
- Git merge hotfix branch into feature branch
- Git submodule update
- How to apply a patch generated with git format-patch?
- What does ‘git merge –abort is equivalent to git reset –merge when MERGE_HEAD is present.’ of Git merge man page mean?
- Abort a Git Merge
- How to delete a remote tag?
- Updates were rejected because the tip of your current branch is behind its remote counterpart
- What does “Changes not staged for commit” mean
- Git : fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists
- git: fatal: Could not read from remote repository
- How do I update Homebrew?
- Git error when trying to push — pre-receive hook declined
- Remove files from Git commit
- How to solve SSL certificate: self signed certificate when cloning repo from github?
- How do I revert a Git repository to a previous commit?
- How to revert multiple git commits?
- How do I fix a Git detached head?
- What is HEAD in Git?
- Why does git say “Pull is not possible because you have unmerged files”?
- What are the differences between git remote prune, git prune, git fetch –prune, etc
- How can I git stash a specific file?
- How to get the current branch name in Git?
- How can I git stash a specific file?
- Move the most recent commit(s) to a new branch with Git
- What does “Git push non-fast-forward updates were rejected” mean?
- How do I diff the same file between two different commits on the same branch?
- How to name and retrieve a stash by name in git?
- You have not concluded your merge (MERGE_HEAD exists)
- How to get the current branch name in Git?
- Git error on commit after merge – fatal: cannot do a partial commit during a merge
- Is there a “theirs” version of “git merge -s ours”?
- Meaning of the GitHub message: push declined due to email privacy restrictions
- Download a specific tag with Git
- Is there a command to undo git init?
- How to undo ‘git reset’?
- Download a single folder or directory from a GitHub repo
- fatal: Not a valid object name: ‘master’
- Git and nasty “error: cannot lock existing info/refs fatal”
- Is there a “git touch” so I can push the same file with a new timestamp?
- Branch from a previous commit using Git
- How do I delete a local repository in git?
- Hard reset of a single file
- Not a valid object name: ‘master’
- git add remote branch
- How do I copy a version of a single file from one Git branch to another?
- Undo a git stash
- Undo git stash pop that results in merge conflict
- Git: cannot checkout branch – error: pathspec ‘…’ did not match any file(s) known to git
- How to clone all remote branches in Git
- Set up git to pull and push all branches
- Invalid VCS root mapping – 3 errors on my project
- Updates were rejected because the remote contains work that you do not have locally
- Undoing a ‘git push’
- What’s the significance of the “No newline at end of file” log?
- What is the difference between pull and clone in git?
- Git update submodules recursively
- Do a “git export” (like “svn export”)?
- how to reset develop branch to master
- What does git push origin HEAD mean?
- “fatal: HttpRequestException encountered.” Error with GitHub/Bitbucket Repositories due to dropping TLS-1.0 support
- Git’s local repository and remote repository — confusing concepts
- How do i git push specific branch?
- fatal: could not read Username for ‘https://github.com’: No such file or directory
- How can I see which Git branches are tracking which remote / upstream branch?
- Could not create work tree dir ‘example.com’.: Permission denied
- TortoiseGit-git did not exit cleanly (exit code 1)
- How to answer the git prompt in npm init for a local repo
- How to `git pull` while ignoring local changes?
- Uninitialize git repository
- How to create a local branch from an existing remote branch?
- Git says “Automatic merge failed”, what does it mean?
- How to configure git bash command line completion?
- What is the .git folder?
- Updating and committing only a file’s permissions using git version control
- Create empty branch on GitHub
- Git – fatal: Unable to create ‘/path/my_project/.git/index.lock’: File exists
- WordPress and Git – What folders should I track?
- What is the usual process of saving changes made at the CMS level into source control?
- Collaboratively develop a WordPress site
- Pull latest stable release via git [closed]
- WordPress Core files not being ignored by Git
- Painless way to track remote Git repo for WordPress updates
- Full site editor, hard-coded IDs in query blocks, and staging/dev servers