CamNel
CamNel

Reputation: 11

(master) at end of terminal prompt

I am just learning more with git and that type of thing and so I just used init with git. After doing this and doing a commit to a repository. I still have (master) at the end of my terminal prompt. I am using a linux ide. How can I back out of this and get back to a normal terminal prompt?

Upvotes: 0

Views: 1588

Answers (3)

k clark
k clark

Reputation: 1

I had the same problem in my terminal which I had base at the beginning and master at the end, (base) meant I was running in an anaconda environment and exit solved that problem, and master relates to what level of the directory you are currently in.

Upvotes: 0

Jake Dube
Jake Dube

Reputation: 2990

The Git branch will be shown (unless you change the PS1 variable as mentioned in Robin Green's answer) if the current directory is in the Git repository. This means all that you need to do is cd (change directory) out of the Git repository.

pwd    # this will show where you are currently 
cd ..  # go to parent directory
cd ~   # go to user's home directory

Note that this not only applies to the root folder, but also any subdirectory, e.g., for the tree shown below, bar is the root of the Git repository, and we know that because the .git folder resides directly within it. This means that bar's parent, foo, and bar's sibling, eggs, are not in the repository.

foo  (outside of repo)
|
+----bar  (inside of repo)
|    | 
|    +----.git
|    |
|    +----spam  (inside of repo)
|
+----eggs  (outside of repo)

Upvotes: 1

Robin Green
Robin Green

Reputation: 33063

There is no problem that needs to be solved. The prompt is just saying that you are on the master branch. It is useful information.

However if for aesthetic reasons you wish to restore the standard shell prompt, so that it doesn't display (master), see e.g. https://askubuntu.com/questions/574485/how-to-return-default-ps1-prompt

Upvotes: 1

Related Questions