Automatic repo deployment via gogs api


#1

Hi all,

I do not use ssh on my server for few reasons (my git server is behin proxy etc…), that means basically that I use http/https for clone and push. Recently I’ve been playing with gogs api and I must say, it works fantastically!

I’ve created simple script called new-repo.sh which does following:

  • it will connect to your gogs and create repo in gogs
  • then automatically initialize repo on your local machine with all necesary commands for git
  • and as last it will push that new repo to your remote repo on your gogs installation

This works for http/https with tokens. The whole script works very easy. Example of usage

  • cd to the folder which you want to create repo from eg: cd Desktop/new-repo
  • once there you just issue command like this: repo name-of-new-repo and hit enter and you are done.

this will first connect to your gogs install via token and it will create name-of-new-repo.git repository for your push, then it will create repo on your machine in exactly that folder you have cd-ied in. Also, your newly repo have buffer setup for 1GB which means you can push repo big as 1gig without errors and also it will pre-setup for you your remote, so next time when you clone that repo or you would make changes on local you can just push them to your remote with simple short, sweet command: git push without any extras.

I am sorry but this works only on linux desktops/laptops/servers or macs or any unix based systems. I use only linux so I am not sure how windows could perform with shell scripts like unix based os as win cmd is just …bad.

I would like to add this somewhere to documentation on gogs.io, by myself or perhaps Unknwon could do that if anyone interested… so whats the process of collaboration?

Thanks.