Home > Net >  Git bash change into a directory and start a file
Git bash change into a directory and start a file

Time:04-08

My default git bash starts on the C: drive and I often have to change into a project directory and start a file up. Is there a way to cd into a directory and start a file all in one command using Git bash on Windows?

CodePudding user response:

Yes, you can directly start with cat command following with complete path using forward slashes as 'cat C:/Users/username/filename' and cd command also works in similar way.

CodePudding user response:

You should have a file .bashrc into your home directory. It should be under C:\Users\login

  1. Add the following line in the file: cd "projet_directory_full_path"
  2. Open a new session and it should start on your project directory
  • Related