New Laptop? Get Git and Xcode setup quickly with this handy guide.

Khalid Asad
3 min readOct 20, 2019

It happens to all of us, maybe we spilled some coffee on our company laptop, or got a new job with a new laptop. This guide is meant to get you setup quickly with some great settings and tweaks.

First things first, you want to install git. There’s a number of ways, but homebrew is my go-to.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

[Optional] Skip the next steps with a brewfile

If you would like to skip most of the next few steps and save time and install everything from a brewfile.

Run

brew tap Homebrew/bundle

and then just download this brewfile:

# specify a directory to install
cask_args appdir: '/Applications'
# install packages
tap 'caskroom/homebrew-cask' || true
brew 'git'
brew 'wget'
# Casks
cask 'iterm2'
cask 'sublime-text'

And then run

brew bundle

Installing git:

brew install git

Install Xcode:

Install iTerm2:

brew install --cask iterm2

Install your favourite text editor (Sublime):

brew install --cask sublime-text

Generate and add an SSH key to your GitHub account:

Add Git Aliases for more efficient commands:

git config --global alias.c commitvim ~/.gitconfig

Add the list of my favourite aliases:

co = checkout
cod = checkout develop
ci = commit
ac = !git add -A && git commit -m
ps = push
pso = push -u origin
pl = pull --rebase
s = status
d = diff
b = for-each-ref --sort=committerdate refs/heads/ --format='%(HEAD) %(color:yellow)%(refname:short)%(color:reset) - %(color:red)%(objectname:short)%(color:reset) - %(contents:subject) - %(authorname) (%(color:green)%(committerdate:relative)%(color:reset))'
lt = log --pretty=format:'%Cred%h %Cgreen%cd%Creset | %s%C(auto)%d %Cgreen[%an]%Creset' --date=local --since=midnight
h = log --pretty=format:\"%h %ad | %s%d [%an]\" --graph --date=short
cb = checkout -b
br = branch -m
bd = branch -D
md = merge develop
type = cat-file -t
dump = cat-file -p
fuckit = reset --hard
amend = !git add -A && git commit --amend --no-edit
l = log --all --no-merges --graph --date=relative --committer=$(git config --get user.email) --pretty=format:'%C(cyan) %ad %C(yellow)%h %Creset %s %Cgreen%d' --since=$(if [[ Mon == $(date +%a) ]]; then echo last friday; else echo yesterday; fi)

Customize your terminal with oh my zsh, PowerLine10k + other tweaks:

Oh my zsh + Powerline 10k + Solarized Dark theme

https://gist.github.com/kevin-smets/8568070

Customize your Xcode Theme:

Install the Trailer App for live updates on PRs and an accessible toolbar button to navigate quickly to Open PRs or issues on macOS, watchOS, and iOS:

That’s all you need to setup your laptop and get to work!

--

--

Khalid Asad

I'm an iOS Developer that loves to tinker and create projects that can make a difference. I'm multi-lingual and work on Swift, Node.js and other languages!