Tag: ssh

Make a local Git repo from master based with Zend Repo as Origin

I would like to make a clone of a master branch on the test server where we have the master branch and the test site running. This repo is a Zend PHP Framework Application. In the config file @ /home/me/public_html/domain.com/ZendSkeletonApplication/.git/config I have now: [core] repositoryformatversion = 0 filemode = true bare = false logallrefupdates = […]

error when cloning git repository with ssh

I set up a git repository in a directory named ABC3 on my remote server public_html/ABC3. git init I want to clone the repository to my local computer. Here’s what I do: cd into the directory where I want to work, say Desktop/GitFun, then I attempt to clone with the following command git clone myusername@myserver.com:/public_html/ABC3.git […]

Using SSH authentication with JGit to Access a Git Repository Securely / Auth fail

I’m using JGit in scala to access a remote Git repo, and I need to use SSH for authentication. JGit uses JSch to provide secure access. I followed this tutorial : http://www.codeaffine.com/2014/12/09/jgit-authentication/ However, i have always, an ,com.jcraft.jsch.JSchException: Auth fail my method is: def sshCloneRemoteRepository() = { // 1 / Override SSH configuration with JschConfigSessionFactory […]

Disable SSH key authentification for one user

For now, I use key authentification for all my server users and it worked very well. Today I’ve just added a git service which job is to serve git repository for everyone : internal users of my server and external. I’ve created a Git user for all the git purpose (daemon, cgit, etc…) The problem […]

git ls-remote hangs when using GIT_SSH

Recently I’ve started seeing a lot of timeouts when deploying to one of my EC2 servers. After some investigating I narrowed the problem down to git ls-remote and GIT_SSH script. This works 100% of the time: eval `ssh-agent -s` && ssh-add key.pem && git ls-remote -h git@github.com:repo This hangs 90% of the time: GIT_SSH=wrapper.sh git […]

SSH into EC2 and can't execute git clone command

I’ve ssh‘d in to a new ec2 instance, which I’m setting up for our production environment, and tried to git clone a project from another ec2 instance which we are using as our development box but I get the below error. $ git clone ubuntu@?.??.??.??6:/var/git/our-project.git our-project Cloning into ‘our-project’… ssh: connect to host ?.??.??.??6 port […]

How to switch from first github account to second?

I worked on Project A with the git credentials(user.name= venkat and user.email=venkat@gmail.com) which is completed successfully. And I started my new Project B. For this I created my login credentials(user.name= venkat-yahoo and user.email=venkat@yahoo.com) and added ssh with new credentials. The ssh generated is fine with new email but when I did my first push to […]

JGit with ssh key in non-default location

I am trying to include calls to a git repo (fetching from remote and committing changes) into my Java program using JGit. I have followed the steps from http://www.codeaffine.com/2014/12/09/jgit-authentication/, but Eclipse gives me some errors. My code for the pull command (currently with the clone command as this is example code from the linked article): […]

ansible in masterless mode git task fails while git clone works on remote server

I am using Ansible to clone a repository on a remote server : This command works on the remote server: git clone git@github.com:ansible/ansible-examples.git This task, however, fails: – name: clone git repo git: repo=git@github.com:ansible/ansible-examples.git dest=/root/ansible-examples clone=yes With the following output: FAILED! => {“changed”: false, “cmd”: “/usr/bin/git ls-remote ” -h refs/heads/HEAD”, “failed”: true, “msg”: “Permission denied […]

OpenShift Jenkins git clone fails: Host key verification failed

I try to build my Node JS (latest version) application in Jenkins in the Red Hat OpenShift environment but it continues to fail with this message in the Jenkins log: Host key verification failed. fatal: Could not read from remote repository. Upon further investigation it turns out the Jenkins server cannot clone the repo from […]

Git Baby is a git and github fan, let's start git clone.