Did you know that you can link your projects to your github account even if the project is hosted on your own private git server? What’s even more interesting is that you can embed the diff gists into places like blog posts to share with you friends and family.
The following is an gist I created to test this theory in a the project we discussed during the last article (see what’s related below). In that article we setup a new repository to home the development of our WordPress projects. So the project is hosted on the internal git server that we setup on FreeBSD and I am using the git diff |gist -t diff command to push the diffs to my github account. This is what I received in return:
The plan going forward is to create a branch for each site that we work on as well a one for the specific plugins, themes or modifications that we plan on developing for the WordPress CMS environment. Unlike subversion which will drop .svn directories inside of every sub-directory git only creates the one. By initializing the main WordPress project in the wpdev directory Git created a top level .git to record all of our code changes. This makes for a cleaner deploy and we do not really need to concern ourselves with additional .htaccess rules to inhibit the access to this special directory because it will be outside of the webroot of our vhost.
Using the tree command we end up with a clean source tree like the following:
> tree -aL 2 . ├── .git │ ├── COMMIT_EDITMSG │ ├── HEAD │ ├── config │ ├── description │ ├── hooks │ ├── index │ ├── info │ ├── logs │ ├── objects │ └── refs ├── secrets.php └── wordpress ├── index.php ├── license.txt ├── readme.html ├── wp-activate.php ├── wp-admin ├── wp-blog-header.php ├── wp-comments-post.php ├── wp-config-sample.php ├── wp-config.php ├── wp-content ├── wp-cron.php ├── wp-includes ├── wp-links-opml.php ├── wp-load.php ├── wp-login.php ├── wp-mail.php ├── wp-settings.php ├── wp-signup.php ├── wp-trackback.php └── xmlrpc.php 10 directories, 23 files
In the above example I limited the output to only two levels deep because it is enough to get the point succinctly across. You can see how that there are no other .git directories. This is fantastic since we will not need to perform any cleanup operations after the deploy. Remember:
The plan is to create a branch for each site, plugin, theme or modification
It is no surprise that I like git better than other version control systems. I have used many different ones from rcs, to cvs to OpenCVS, and of course svn. Each version control has it’s strengths I just prefer the flexibility of git especially when working on web based projects. Obviously there are ways of working around the limitations or design features of other systems but why bother when there is already a tool that handles what i need cleanly? When I was in my c programming class back at NYU the professor stated on the first day that:
“Programmers are the laziest people in the world…”
Of course when everyone in the class proclaimed they were not at all lazy, he then continued with, “Because they are always writing software to do they work for them ultimately making less work for themselves to do…” Like that, git makes less work for me to do and helps me achieve maximum productivity. I am not here to tell you what version control system you should use just find the one that you are comfortable with and that does not adversely affect your work load.
Related articles
Google says
I simply could not go away your web site prior to suggesting that I
actually enjoyed the standard info an individual provide to your
guests? Is gonna be again frequently to check out new posts