UNIX & GNU/Linux - bash - Setting a profile with the Git prompt

You have downloaded and installed your Git Bash on Windows.

That's a good thing.

But if you want to change your prompt as your favorite one, you have to create a file and add your own settings.

Let's see this.

First of all

After downloading Git bash and installed it, if you launch it you'll have a classic prompt.

To have something different, you have to create a new file .profile to override the default settings.

Setting the .profile file

Open your Git bash then type the following command:

cd ~/

You are now in your user folder, such as:

/c/users/mi-k

Or more Windows friendly:

C:\Users\Mi-K

To create the file just use the touch tools:

touch .profile

And modify it with your favorite text editor.

Inside you can for example add something like this:

alias ll="ls -la"

To apply the modification, just write the following command after saving your .profile:

. .profile

And type the new alias to see the modification:

ll

You can of course add everything you want in this .profile file in order to have the shell you like.

For example, you can easily change the appareance of your prompt and you don't need other files for that.

Conclusion

A tiny tutorial but I think useful.

Well done, once again you did it! cool

 

Add new comment

Plain text

  • No HTML tags allowed.
  • Lines and paragraphs break automatically.
CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.