DEV Community

Alex Nostadt
Alex Nostadt

Posted on

3 1

How I speed up my daily developing in terminal context

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?

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

Top comments (0)

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay