webpackJsonp([0xf7d505d33e7a],{370:function(e,t){e.exports={data:{markdownRemark:{html:'

\n \n \n \n \n \n

\n

It has been said that "the whole is greater than the sum of its parts"1. Building websites these days is an ever more complicated process. One that requires knowledge of a variety of technologies and techniques. Especially if you want to build websites that can be viewed in a meaningful and useful way on an increasingly large device landscape. Our job as web developers is to find the right combination of these tools and use them wisely. Hopefully the end result is an optimal experience that delivers more than would have been possible without them.

\n

Below you will find a list of some of the technologies and techniques used to build this website. I\'ll write up in depth articles on each of these topics later and link to them from here.

\n\n

I\'ll keep this post updated with any further additions/changes to the website as and when.

\n

1. Aristotle

',frontmatter:{teaser:"Delivering an optimal experience to an ever increasing list of devices requires a host of different techniques and technologies. Take a look under the bonnet (that's the hood if you're from across the pond) of this site.",date:"03 November 2013",path:"/blog/the-sum-of-its-parts",title:"The sum of its parts"}}},pathContext:{prev:{html:'

\n \n \n \n \n \n

\n

A quick reference guide to the most common and useful Git commands.

\n

Create

\n

Create a new local repo from existing files.

\n
$ cd myproject\n$ git init\n$ git add .\n$ git commit\n
\n

Clone an existing remote repo

\n
$ git clone git://example.com/myproject\n$ cd myproject\n
\n

... or just the repo contents (note the . at the end of the clone command)

\n
$ mkdir myproject\n$ cd myproject\n$ git clone git://example.com/myproject .\n
\n

Browse

\n
$ git status\n# On branch master\nnothing to commit (working directory clean)\n$ git branch -a\n* master\n  remotes/origin/master\n
\n

Branch

\n

Checkout a new local branch (and switch to it) then create remotely too.

\n
$ git checkout -b dev\nSwitched to a new branch \'dev\'\n$ git branch -a\n* dev\n  master\n  remotes/origin/master\n$ git push origin dev\n$ git branch -a\n* dev\n  master\n  remotes/origin/dev\n  remotes/origin/master\n
\n

Checkout an existing local branch, update from remote, merge in another and update to remote.

\n
$ git checkout master\nSwitched to branch \'master\'\n$ git pull origin master\n$ git merge dev\n$ git push origin master\n
\n

Files

\n

Add new files to be tracked and commit.

\n
$ git status\n# On branch master\n#\n# Initial commit\n#\n# Untracked files:\n#   (use "git add ..." to include in what will be committed)\n#\n#\tmyfile.html\nnothing added to commit but untracked files present (use "git add" to track)  \n  \n$ git add myfile.html  \n  \n$ git status\n# On branch master\n#\n# Initial commit\n#\n# Changes to be committed:\n# (use "git rm --cached ..." to unstage)\n#\n# new file: myfile.html\n#  \n  \n$ git commit -m"My commit message"\n[master (root-commit) b46f4f8] My commit message\n 0 files changed\n create mode 100644 myfile.html\n
\n

Add modified files via interactive method to be staged and commit.

\n
$ git status\n# On branch master\n# Your branch is ahead of \'origin/master\' by 2 commits.\n#\n# Changes not staged for commit:\n#   (use "git add ..." to update what will be committed)\n#   (use "git checkout -- ..." to discard changes in working directory)\n#\n#\tmodified:   anotherfile.html\n#\tmodified:   myfile.html\n#\nno changes added to commit (use "git add" and/or "git commit -a")  \n  \n$ git add -i\n           staged     unstaged path\n  1:    unchanged        +1/-0 anotherfile.html\n  2:    unchanged        +1/-1 myfile.html  \n  \n*** Commands ***\n  1: status\t  2: update\t  3: revert\t  4: add untracked\n  5: patch\t  6: diff\t  7: quit\t  8: help\nWhat now> 2\n           staged     unstaged path\n  1:    unchanged        +1/-0 anotherfile.html\n  2:    unchanged        +1/-1 myfile.html\nUpdate>> 1-2\n           staged     unstaged path\n* 1:    unchanged        +1/-0 anotherfile.html\n* 2:    unchanged        +1/-1 myfile.html\nUpdate>> \nupdated 2 paths  \n  \n*** Commands ***\n  1: status\t  2: update\t  3: revert\t  4: add untracked\n  5: patch\t  6: diff\t  7: quit\t  8: help\nWhat now> 7\nBye.\n$ git status\n# On branch master\n# Your branch is ahead of \'origin/master\' by 2 commits.\n#\n# Changes to be committed:\n#   (use "git reset HEAD ..." to unstage)\n#\n#\tmodified:   anotherfile.html\n#\tmodified:   myfile.html\n#  \n  \n$ git commit -m"Another commit message"\n[master 85ee80f] Another commit message\n 2 files changed, 2 insertions(+), 1 deletion(-)\n
\n

Stash

\n

So you need to work on a different branch but have changes in your current branch that you don\'t yet want to commit. Git\'s handy Stash lets you store your current changes and then restore (apply) them when you return to the branch later.

\n
$ git stash\nSaved working directory and index state WIP on master: 85ee80f Another commit message\nHEAD is now at 85ee80f Another commit message\n$ git stash list\nstash@{0}: WIP on master: 85ee80f Another commit message\n$ git checkout someotherbranch\n...\n...\n...\n$ git checkout master\n$ git stash apply\n
\n

You can also clear your previous stashed states too.

\n
$ git stash clear\n
\n

Cherry Pick

\n

On occasion you might need to merge a specific commit from one branch to another, rather than merge the whole branch over. You first need to find the SHA for the specific commit in the source branch. Note that you only need the first 6 or 7 characters, enough to be a unique reference. Then we can cherry-pick that commit in to the destination branch.

\n
$ git checkout dev\n$ git log --pretty=oneline\n87ef1e6557ebec91ea8dd8f2eb4fc302c83a5381 cherry pick test\n85ee80f59832d2f93db64f7b6deef355e41d8e65 Another commit message\nb9a3ba26698f404b65f2182a47267cc097c34a19 adding removed file\n$ git checkout master\nSwitched to branch \'master\'\n$ git cherry-pick 87ef1e6\n[master 797180a] cherry pick test\n 1 file changed, 1 insertion(+), 1 deletion(-)\n
\n

Tag

\n

The usual approach to marking release points in your code is to create a tag (and then test and deploy that tag). Make sure you have the latest tags from the remote repo first before creating a new one. Also be sure to push the new tag back to the remote repo.

\n
$ git pull origin master --tags\n$ git tag\nv1.0.1\n$ git tag -a v1.0.2 -m"Creating a new release"\n$ git tag\nv1.0.1\nv1.0.2\n$ git push origin master --tags\nCounting objects: 1, done.\nWriting objects: 100% (1/1), 170 bytes, done.\nTotal 1 (delta 0), reused 0 (delta 0)\n * [new tag]         v1.0.2 -> v1.0.2\n
\n

Reset

\n

On occasion you might find that you want to bin all the changes you have made and return the current branch to it\'s last commit. What? You\'ve never started work on the wrong branch before? For the less than perfect of us (that includes me!), Git\'s Reset provides the solution. Whilst Reset comes furnished with several options for different scenarios, there is one in particular which fits our situation perfectly. Please note that this is of course destructive...you will lose all your changes since the last commit.

\n
$ git reset --hard\nHEAD is now at 85ee80f Another commit message\n
\n

Inspection

\n

If you get lost with your commits or just want to dig a bit deeper into the commit history, Git provides a great tool. Gitk allows you to not only view the actual files changes within each commit but to also view a commit graph.

\n

To view all files

\n
$ gitk\n
\n

To view a specific file

\n
$ gitk /path/to/file/filename\n
\n

Or if you prefer a quick in-command-line method...

\n
$ git log\ncommit 797180a46e90876f0610d3256ecff9b466ab677c\nAuthor: MyName <myname@mydomain.com>\nDate:   Sun Nov 10 10:45:23 2013 +0000  \n  \n    cherry pick test  \n  \ncommit 85ee80f59832d2f93db64f7b6deef355e41d8e65\nAuthor: MyName <myname@mydomain.com>\nDate:   Sat Nov 9 22:40:10 2013 +0000  \n  \n    Another commit message\n
\n

...and we can simplify the output too.

\n
$ git log --pretty=oneline\n797180a46e90876f0610d3256ecff9b466ab677c cherry pick test\n85ee80f59832d2f93db64f7b6deef355e41d8e65 Another commit message\n
',id:"/home/geoff/www/cornerpiece/geoffford.co.uk/src/pages/blog/06-11-2013-git-cheat-sheet/index.md absPath of file >>> MarkdownRemark",frontmatter:{date:"2013-11-06T19:29:30Z",path:"/blog/git-cheat-sheet",title:"Git cheat sheet"}},next:{html:'

\n \n \n \n \n \n

\n

Hi! I\'\'d like to welcome you all to my shiny new website. If you have just stumbled across this post and have no idea who I am, check out my about page. In short, my name is Geoff Ford (I know, it\'\'s my domain name...but you can never assume eh?). I\'\'m an all round web dev that works on all aspects of the development cycle but truth be told my heart is really in front end development, especially the responsive kind. If none of this means anything to you, we can still be friends but this blog will undoubtedly bore the socks|pants|ass off you!

\n

I have wanted to create a personal website and blog for some time now to both put my thoughts down into words (for my own future reference) and to share any goodies, mine or otherwise, with anyone who cares to listen. This will predominantly consist of web development related topics with the odd bit of whatever else here and there.

\n

The plan is to firstly write about the various processes and technologies used to create this responsive site (give it a try on your phone, tablet, laptop, etc or just resize a browser window on your pc|mac). Later I aim to cover any new developments, discoveries, and lessons learned along the way.

\n

Lastly, I am new to blogging so forgive me if I waffle, baffle or just miss the point entirely. Like anything else I\'\'m sure there is a learning curve to overcome.

\n

So, with all that said let\'\'s crack on!

',id:"/home/geoff/www/cornerpiece/geoffford.co.uk/src/pages/blog/27-10-2013-and-so-the-journey-begins/index.md absPath of file >>> MarkdownRemark",frontmatter:{date:"2013-10-27T23:33:07Z",path:"/blog/and-so-the-journey-begins",title:"And so the journey begins"}}}}}}); //# sourceMappingURL=path---blog-the-sum-of-its-parts-52bc151a0ac14c486329.js.map