{"action":"created","comment":{"url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/comments/37271487","id":37271487,"diff_hunk":"@@ -0,0 +1,120 @@\n+---\n+layout: post\n+title: Tab completing bash functions for a speedy workflow\n+categories: bash\n+author: jack_crawford\n+tags: bash terminal shell\n+comments: true\n+excerpt: \"As a developer, I spend a lot of my time on the command line. As a developer, I also hate repeating myself. This is why I love using bash aliases and functions wherever possible to speed up my workflow.\"\n+---\n+\n+As a developer, I spend a lot of my time on the command line. As a developer, I also hate repeating myself. This is why I love using bash aliases and functions wherever possible to speed up my workflow.\n+\n+I'd estimate that I spend ~98-99% of my Terminal time in various subfolders of my `git` directory, where (you guessed it!) all of my git repositories live. This means that I regularly have to type `cd ~/path/to/git/repo-name`. I can add a simple function to my `~/.bash_profile` to save a little time here.\n+\n+```bash\n+# go git! cd straight to the git directory\n+gg() {\n+  cd ~/path/to/git; pwd;\n+}\n+```\n+\n+Changes to the `~/.bash_profile` usually only take effect when you log in again, we can force this to happen in the same window with `bash --login`. Alternatively, we can source the file with `source ~/.bash_profile` which, like any command, we can add an alias for to save some keystrokes in the future.\n+\n+```bash\n+# bash reload\n+alias br='. ~/.bash_profile'","path":"_posts/2015-08-17-tab-complete-a-different-directory.md","position":26,"original_position":26,"commit_id":"37b67806ceed80e072d5775260b9ac3e236b8ea1","original_commit_id":"37b67806ceed80e072d5775260b9ac3e236b8ea1","user":{"login":"pmcnr-hx","id":10811943,"avatar_url":"https://avatars.githubusercontent.com/u/10811943?v=3","gravatar_id":"","url":"https://api.github.com/users/pmcnr-hx","html_url":"https://github.com/pmcnr-hx","followers_url":"https://api.github.com/users/pmcnr-hx/followers","following_url":"https://api.github.com/users/pmcnr-hx/following{/other_user}","gists_url":"https://api.github.com/users/pmcnr-hx/gists{/gist_id}","starred_url":"https://api.github.com/users/pmcnr-hx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pmcnr-hx/subscriptions","organizations_url":"https://api.github.com/users/pmcnr-hx/orgs","repos_url":"https://api.github.com/users/pmcnr-hx/repos","events_url":"https://api.github.com/users/pmcnr-hx/events{/privacy}","received_events_url":"https://api.github.com/users/pmcnr-hx/received_events","type":"User","site_admin":false},"body":"Should be consistent in the usage of `source` and `.` to source a file or mention that they are equivalent.","created_at":"2015-08-18T07:37:46Z","updated_at":"2015-08-18T07:37:46Z","html_url":"https://github.com/holidayextras/holidayextras.github.com/pull/50#discussion_r37271487","pull_request_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50","_links":{"self":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/comments/37271487"},"html":{"href":"https://github.com/holidayextras/holidayextras.github.com/pull/50#discussion_r37271487"},"pull_request":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50"}}},"pull_request":{"url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50","id":42629620,"html_url":"https://github.com/holidayextras/holidayextras.github.com/pull/50","diff_url":"https://github.com/holidayextras/holidayextras.github.com/pull/50.diff","patch_url":"https://github.com/holidayextras/holidayextras.github.com/pull/50.patch","issue_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/50","number":50,"state":"open","locked":false,"title":"Tab completing bash functions for a speedy workflow","user":{"login":"jackdcrawford","id":1485654,"avatar_url":"https://avatars.githubusercontent.com/u/1485654?v=3","gravatar_id":"","url":"https://api.github.com/users/jackdcrawford","html_url":"https://github.com/jackdcrawford","followers_url":"https://api.github.com/users/jackdcrawford/followers","following_url":"https://api.github.com/users/jackdcrawford/following{/other_user}","gists_url":"https://api.github.com/users/jackdcrawford/gists{/gist_id}","starred_url":"https://api.github.com/users/jackdcrawford/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jackdcrawford/subscriptions","organizations_url":"https://api.github.com/users/jackdcrawford/orgs","repos_url":"https://api.github.com/users/jackdcrawford/repos","events_url":"https://api.github.com/users/jackdcrawford/events{/privacy}","received_events_url":"https://api.github.com/users/jackdcrawford/received_events","type":"User","site_admin":false},"body":"### Blog title\r\nTab completing bash functions for a speedy workflow\r\n\r\n### Blog description\r\nBash aliases & functions are awesome for ~~laziness~~productivity. My bash skills are fairly amateur but I like to have a dabble when I get the time to try & make my life easier. \r\n\r\nLooking for some feedback on this, be honest!\r\n1. Can it be improved?\r\n2. Is it actually useful/interesting?\r\n\r\n#### Author\r\n- [x] I have checked for grammatical errors\r\n- [x] I have checked for spelling errors\r\n- [x] All information (technical or otherwise) is correct to my knowledge\r\n\r\n#### Editor 1\r\n- [ ] I have checked for grammatical errors\r\n- [ ] I have checked for spelling errors\r\n- [ ] All information (technical or otherwise) is correct to my knowledge\r\n\r\n#### Editor 2\r\n- [ ] I have checked for grammatical errors\r\n- [ ] I have checked for spelling errors\r\n- [ ] All information (technical or otherwise) is correct to my knowledge","created_at":"2015-08-17T20:20:23Z","updated_at":"2015-08-18T07:37:46Z","closed_at":null,"merged_at":null,"merge_commit_sha":"aee7fc1a4b1b8557e1599bc82f0447f1281860a9","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50/commits","review_comments_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50/comments","review_comment_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/comments{/number}","comments_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/50/comments","statuses_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/statuses/37b67806ceed80e072d5775260b9ac3e236b8ea1","head":{"label":"holidayextras:tab-completion","ref":"tab-completion","sha":"37b67806ceed80e072d5775260b9ac3e236b8ea1","user":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"repo":{"id":3348394,"name":"holidayextras.github.com","full_name":"holidayextras/holidayextras.github.com","owner":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holidayextras/holidayextras.github.com","description":"Hungry Geek","fork":false,"url":"https://api.github.com/repos/holidayextras/holidayextras.github.com","forks_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/forks","keys_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/teams","hooks_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/hooks","issue_events_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/events","assignees_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/tags","blobs_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/languages","stargazers_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/stargazers","contributors_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/contributors","subscribers_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/subscribers","subscription_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/subscription","commits_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/merges","archive_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/downloads","issues_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/labels{/name}","releases_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/releases{/id}","created_at":"2012-02-03T21:17:14Z","updated_at":"2015-06-25T21:31:23Z","pushed_at":"2015-08-17T21:47:00Z","git_url":"git://github.com/holidayextras/holidayextras.github.com.git","ssh_url":"git@github.com:holidayextras/holidayextras.github.com.git","clone_url":"https://github.com/holidayextras/holidayextras.github.com.git","svn_url":"https://github.com/holidayextras/holidayextras.github.com","homepage":"http://hungrygeek.holidayextras.co.uk/","size":10364,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"base":{"label":"holidayextras:master","ref":"master","sha":"daf956c2da03e537e8258bf7661560748ffd160f","user":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"repo":{"id":3348394,"name":"holidayextras.github.com","full_name":"holidayextras/holidayextras.github.com","owner":{"login":"holidayextras","id":286993,"avatar_url":"https://avatars.githubusercontent.com/u/286993?v=3","gravatar_id":"","url":"https://api.github.com/users/holidayextras","html_url":"https://github.com/holidayextras","followers_url":"https://api.github.com/users/holidayextras/followers","following_url":"https://api.github.com/users/holidayextras/following{/other_user}","gists_url":"https://api.github.com/users/holidayextras/gists{/gist_id}","starred_url":"https://api.github.com/users/holidayextras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/holidayextras/subscriptions","organizations_url":"https://api.github.com/users/holidayextras/orgs","repos_url":"https://api.github.com/users/holidayextras/repos","events_url":"https://api.github.com/users/holidayextras/events{/privacy}","received_events_url":"https://api.github.com/users/holidayextras/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/holidayextras/holidayextras.github.com","description":"Hungry Geek","fork":false,"url":"https://api.github.com/repos/holidayextras/holidayextras.github.com","forks_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/forks","keys_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/keys{/key_id}","collaborators_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/teams","hooks_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/hooks","issue_events_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/events{/number}","events_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/events","assignees_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/assignees{/user}","branches_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/branches{/branch}","tags_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/tags","blobs_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/refs{/sha}","trees_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/trees{/sha}","statuses_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/statuses/{sha}","languages_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/languages","stargazers_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/stargazers","contributors_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/contributors","subscribers_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/subscribers","subscription_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/subscription","commits_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/commits{/sha}","git_commits_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/git/commits{/sha}","comments_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/comments{/number}","issue_comment_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/comments{/number}","contents_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/contents/{+path}","compare_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/compare/{base}...{head}","merges_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/merges","archive_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/downloads","issues_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues{/number}","pulls_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls{/number}","milestones_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/milestones{/number}","notifications_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/labels{/name}","releases_url":"https://api.github.com/repos/holidayextras/holidayextras.github.com/releases{/id}","created_at":"2012-02-03T21:17:14Z","updated_at":"2015-06-25T21:31:23Z","pushed_at":"2015-08-17T21:47:00Z","git_url":"git://github.com/holidayextras/holidayextras.github.com.git","ssh_url":"git@github.com:holidayextras/holidayextras.github.com.git","clone_url":"https://github.com/holidayextras/holidayextras.github.com.git","svn_url":"https://github.com/holidayextras/holidayextras.github.com","homepage":"http://hungrygeek.holidayextras.co.uk/","size":10364,"stargazers_count":1,"watchers_count":1,"language":"HTML","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":1,"mirror_url":null,"open_issues_count":3,"forks":1,"open_issues":3,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50"},"html":{"href":"https://github.com/holidayextras/holidayextras.github.com/pull/50"},"issue":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/50"},"comments":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/issues/50/comments"},"review_comments":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50/comments"},"review_comment":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/pulls/50/commits"},"statuses":{"href":"https://api.github.com/repos/holidayextras/holidayextras.github.com/statuses/37b67806ceed80e072d5775260b9ac3e236b8ea1"}}}}