Bash – How to create alias for git bash to make fast cd through directories

bashcmdgitgit-bash

I'm using git bash and let say i have 2 folders: C:/folder1 and C:/folder2, I'd like to make fast cd from one to another.

I've tried git.alias but it seems to work for "git …" commands only.. and I'm not very familiar with all this bash stuff.. so how should I do that?

Best Answer

In bash you could do the following to create alias:

alias cdf1="cd /user/home/cloudera"
cd /user
cdf1
pwd

You will get result of pwd as /user/home/cloudera. You could do the same in git-bash prompt as well with directory as "C:/folder1" instead of "/user/home/cloudera".