1

I'm using git portable on windows. It's rather user friendly, but there is one thing that bothers me. Every time I run it I have to type the entire path to the project directory, which is quite long sometimes. Maybe it's not a serious problem, but it would be very nice to shorten it. I tried the following:

  • bash script.sh // cd in this file // nothing happens
  • create symbolic link it - it just copies the directory
  • create windows shortcut - can't open it within git console

Anybody managed to solve this?

3 Answers 3

1

You can right click on the Windows shortcut that launches Git Bash, edit its properties and modify the "Start in" path to your project path. Every time you launch this shortcut, it will cd into that project path.

Or you can add an alias to your ~/.bashrc like below:

alias proj="cd /path/to/project/" 

This will allow you to cd into the project dir on demand by typing the alias name at the prompt.

Sign up to request clarification or add additional context in comments.

Comments

0

If you run git-bash.bat from Portable git, it should work mostly as normal git installation. So, to work with a specific repository, just cd into it:

cd /c/code/MyRepo/ git whatever 

3 Comments

The thing is I'd like to create a script or something that would cd to this path for me. (Several scripts for several different directories)
I don't understand why. Could you clarify that? This shouldn't be something you do often, only every time you start working with that repository.
Hehe, laziness I guess.. Like I said in the question, it's not a big deal, but it's always better to do things faster - that's why people developed shortcuts. :)
0

I've added

cd /c/dev 

to

~/.bashrc 

with

echo cd /c/dev >> ~/.bashrc 

But I'm running MSysGit the non-portable version. Hope this helps in some way anyway.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.