Automatically creating working directory and remote github repo

After migrating to github and cleaning up my local dev environment, I wanted to automate creation of new projects as much as possible. https://gist.github.com/1565820 is a bash function I added (actually, it’s two) to help me automate some of the process.

The first function in that gist is newproject. First, it creates the repo using the github API. It then creates both a public directory where the local repo is initialized, and also a second, testing directory that I use to actually test the code from so that I can keep passwords and such.

In order to keep these two directories in sync, I also use the cptest function to rsync between the two (This is the second function).

newproject then initiates the local repo, links it to remote, adds a README file and pushes it to remote to ensure the repo works.

This is saving me a lot of time in converting my old projects and cleaning up my dev environment.

Leave a Reply

  • (will not be published)

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>