# Facing issues with git clone + ssh

**URL:** <https://drone.discourse.group/t/facing-issues-with-git-clone-ssh/11111>\
**Category:** Drone Support\
**Created:** [December 18, 2019, 10:20pm UTC](https://drone.discourse.group/t/facing-issues-with-git-clone-ssh/11111 "2019-12-18T22:20:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![grv231](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/grv231/32/5522_2.png) [@grv231](https://drone.discourse.group/u/grv231)\
**Post date:** [December 18, 2019, 10:20pm UTC](https://drone.discourse.group/t/facing-issues-with-git-clone-ssh/11111/1 "2019-12-18T22:20:30Z")

</div>

I wanted to understand if there is a plugin I can use for github clone + ssh. Was checking for **drone-plugins** github repo and found this: _[https://github.com/drone-plugins/drone-git-action](https://github.com/drone-plugins/drone-git-action)_

The documentation seems to be broken on this repo as the \*\* [the docs]\*\* link is redirecting to plugins page where this plugin is not published anymore, hence not able to use it.

Additionally have gone through the link: _[Clone by SSH not HTTP / GIT Server port override](http://discuss.harness.io/t/clone-by-ssh-not-http-git-server-port-override/5408)_

which mentions disabling the current clone step and making a new step for clone. Any suggestions?

Thanks,  
Gaurav

---

<div class="post-metadata">

**Author:** ![bradrydzewski](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/bradrydzewski/32/3513_2.png) [@bradrydzewski](https://drone.discourse.group/u/bradrydzewski)\
**Post date:** [December 18, 2019, 10:42pm UTC](https://drone.discourse.group/t/facing-issues-with-git-clone-ssh/11111/2 "2019-12-18T22:42:23Z")

</div>

I’m not familiar with the git action plugin … maybe it was a prototype someone was working on? @tboerger can you provide some more details? If no plugin exists you might consider creating your own.

Otherwise as you mentioned you can just disable the default clone step and use your own git clone commands, as described here:  
[https://docs.drone.io/pipeline/docker/syntax/cloning/](https://docs.drone.io/pipeline/docker/syntax/cloning/)

---

<div class="post-metadata">

**Author:** ![tboerger](https://yyz1.discourse-cdn.com/flex003/user_avatar/drone.discourse.group/tboerger/32/4036_2.png) [@tboerger](https://drone.discourse.group/u/tboerger)\
**Post date:** [December 19, 2019, 7:09am UTC](https://drone.discourse.group/t/facing-issues-with-git-clone-ssh/11111/3 "2019-12-19T07:09:33Z")

</div>

Yeah looks like I forgot to submit some documentation for this plugin. I’m actively using this plugin, but mostly for http cloning. It should work totally fine for ssh cloning and pushing. It could work like this:

```auto
kind: pipeline
type: docker
name: custom-clone

platform:
  os: linux
  arch: amd64

clone:
  disable: true

steps:
  - name: clone
    image: plugins/git-action:1
    settings:
      actions:
        - clone
      remote: git@github.com:my-organization/my-repo.git
      branch: master
      path: /drone/src
      ssh_key:
        form_secret: secret-with-private-ssh-key

  // your steps

  - name: commit
    image: plugins/git-action:1
    settings:
      actions:
        - commit
        - push
      message: 'Automated update of foo [skip ci]'
      branch: master
      author_email: drone@example.com
      author_name: Drone
      ssh_key:
        form_secret: secret-with-private-ssh-key
    when:
      ref:
        exclude:
          - refs/pull/**

```

Maybe this example is not directly working, I have written most of that without testing it out, but you can see this plugin in action in repos like [https://github.com/owncloud/ocis-hello/blob/master/.drone.star#L473-L560](https://github.com/owncloud/ocis-hello/blob/master/.drone.star#L473-L560) which clones the repo from master branch, generates a changelog and commits the changelog to the master branch.
