Git pull via SSH

I try set up jenkins for automatically execute git pull from bitbucket. I created an SSH on repository and executed ssh -T [email protected] and got response:

authenticated via a deploy key. You can use git or hg to connect to Bitbucket. Shell access is disabled.This deploy key has read access to the following repositories:

If I try execute ssh git pull the console does infinite loading.. Why?

Upvotes: 1

Views: 8265

Answers (2)

Viliam Kocinsky
Viliam Kocinsky

Reputation: 56

Did you clone repository? You should be able to login to Bitbucket web interface and in you profile add your public SSH key. Then you can clone repository. From Bitbucket webinterface --> repo --> click on clone. This will pop up window with ssh command to clone repository. Once you repo is cloned, you should be able to use

    git pull
    ...edit,add,commit
    git push

Upvotes: 1

Dmitrii Smirnov
Dmitrii Smirnov

Reputation: 7528

There is no need to manually open SSH connection - git will do it itself. You just need to tell git to pull a specify from which repository. Git will parse the URL, and invoke SSH if needed.

And this is the best practice to disable shell access to git hosts. See e.g. https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server

Upvotes: 0

Related Questions