DEV Community

loading...

How I speed up my daily developing in terminal context

amartinno1 profile image Alex Nostadt ・1 min read

As lots of developer I don't want to waste time with typing more than necessary. So, I began to dig a little into bash and the possibilities and got a few alias's and scripts which helps me to speed up regularly tasks from booting up my virtual machine to updating my local git repository.

It's available in a GitHub repository of mine: https://github.com/AMartinNo1/terminal-helper

My most used alias's are:
alias vup="vagrant up'
alias vhalt="vagrant halt'
alias vssh='vagrant ssh'

Thus the alias's don't save much typing it does feels much faster.

Despite these I also wrote alias to quickly cd into projects. If I was working on dev.to it would be sth like:
alias devto='cd /path/to/repo/'

Since mid of this week I added a little bash script which automatically updates my master and development branch and then goes back to my working Branch. As I work on a project with multiple people I can quickly update main branches and merge/rebase if necessary. Additional this ensures I always have up to date branches.

function gitBranchSimple() {
  git branch | grep "\*" | sed -e 's/* //g'
}

function gitUpdateLocalRepository() {
  currentBranch=$(gitBranchSimple)
  echo "Checking out master...";
  git checkout master
  echo "Pulling latest commits from remote master...";
  git pull
  echo "Checking out develop...";
  git checkout develop
  echo "Pulling latest commits from remote develop...";
  git pull
  echo "Switch back to original branch...";
  git checkout $currentBranch
}

Having this in a repository allows an easy sync between devices as well.

How do you speed up your developing?

Discussion (0)

pic
Editor guide