Skip to content

Commit

Permalink
Merge branch 'master' into docker-for-desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
shahidhk committed Jul 27, 2018
2 parents cc5a647 + f87df24 commit 34ac8c1
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions docs/using-with-github.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
## Using Gitkube with external git providers (like Github)

As it stands, a Gitkube remote is just for deployment and should not be considered as a storage medium like GitHub.
If however one would like for `git push` to both deploy to a kubernetes cluster as well as store code for the long haul in GitHub,
this can be achieved.

One simple way to achieve this is to begin with an origin remote pointing to Github and then add the Gitkube repository as a push
url for the origin remote. The following example presumes that you already have two remotes: one pointing to Github and the other
to Gitkube.

```
$ git remote -v
origin git@github.com/<github-owner>:<github-repo>.git (fetch)
origin git@github.com/<github-owner>:<github-repo>.git (push)
myremote <gitkube-remote-url> (fetch)
myremote <gitkube-remote-url> (push)
```

Now let's set both urls for the `origin` remote.

```
$ git remote set-url --add --push origin git@github.com/<github-owner>:<github-repo>.git
$ git remote set-url --add --push origin <gitkube-remote-url>
$ git remote -v
origin git@github.com/<github-owner>:<github-repo>.git (fetch)
origin git@github.com/<github-owner>:<github-repo>.git (push)
origin <gitkube-remote-url> (push)
myremote <gitkube-remote-url> (fetch)
myremote <gitkube-remote-url> (push)
```

Now `git push origin master` will push the code to both remotes.

Fore more info check out [this Stack Overflow thread.](https://stackoverflow.com/questions/14290113/git-pushing-code-to-two-remotes)

0 comments on commit 34ac8c1

Please sign in to comment.