简体   繁体   中英

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 git@bitbucket.org 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?

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 eg https://git-scm.com/book/en/v2/Git-on-the-Server-Setting-Up-the-Server

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM