5 Git Commands You Should Know

That will save you a load of time.

Ashleigh Danks
1 min readNov 6, 2017

General Shortcuts

Atom

CMD/terminal

Packages

This post is part a series I have put together on saving time and increasing productivity, click the links above to check out my other posts.

I only have included commands I initially didn’t know and saved me time when I discovered them.

Commands are the same for both

git checkout -b branchName
Create a new branch and move into it with one command, i.e. rather than
git branch branchName
git checkout branchName

git branch -d branchName
Delete a local branch. NOTE the use of a -D can force this for branches that aren’t fully merged.

git remote prune origin
Removes all remote branches that have been deleted on GitHub.

git branch -a
Show all local and remote branches.

git commit -am ‘message’
Adds all upstaged files to staging and commits them in one command.

I’ll update this list as I continue to develop and if there any great shortcuts you think I should include drop me a comment.

--

--