Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get out of a folder using Git Bash

I am using Git Bash and am trying a few things like making a 'commit' and 'push' to GitHub. I want to get out of the current directory C:\user\myUsername\app and land in the C:\user\myUsername folder.

What commands do I write in Git Bash?

like image 852
vin Avatar asked Jun 23 '12 15:06

vin


People also ask

How do I change directory in bash?

Example 01: Check Current Working Directory The cd command in Git Bash allows you to move within the directories, probably from the current directory to another directory. The command “cd” means “change directory.” The cd command can be widely used in any Linux system's shells (cmd) for the same purpose.

How do I Unjoin a directory in git?

Use rm -r switch with the git command to remove directory recursively. After removing the directory you need to commit changes to the local git repository. Then push the changes to remove the directory from the remote git repository.

How do I navigate to C drive in git bash?

In order to navigate to a different drive/directory you can do it in convenient way (instead of typing cd /e/Study/Codes), just type in cd[Space], and drag-and-drop your directory Codes with your mouse to git bash, hit [Enter].


2 Answers

To change your directory in git-bash to that specific path you can use this command :

cd /c/user/myUsername 

basically you have to replace backslash with standard slash, or otherwise if you simply want to go to the parent directory you can use :

cd .. 

as stated in comments that you already received on your question ...

like image 88
aleroot Avatar answered Sep 22 '22 00:09

aleroot


Just wanted to add, make sure to insert space between cd and ..

no: cd.. yes: cd .. 
like image 37
bullettrain Avatar answered Sep 21 '22 00:09

bullettrain