-3

Hello all,

As you can see from this screenshot, I was in the test branch by mistake and the folder shajhanshi is happened to be my main directory.

Which command I should use to exit from that? I tried few commands but none of them worked. I'm a newbie in using git commands. Thank you.

Shashi
  • 1
  • 5

1 Answers1

1

That depends on which branch you want to be on for further development.

If you want to be on the master branch you would go back to that with the command: git checkout master

Ben
  • 1,287
  • 15
  • 24
  • if any other branch replace `master` with the name of the branch you do want to be on – Marit Jan 15 '18 at 20:21
  • I don't want to be on any branch Ben. I just want to come out from the #test branch. I want to see my terminal without any branch. I accidentally checked out in test branch. Thank you for your reply. – Shashi Jan 15 '18 at 20:24
  • With git you have to be on a branch of some kind. The branch that repositories get set up with by default is called "master". The only way to 'come out' from the "test" branch is to switch to a different one. – Ben Jan 15 '18 at 20:27
  • Your terminal is showing your current branch because of how your prompt is set up. When you change your working directory to one that does not contain a git repository, the text 'test' should disappear. Alternatively you could change your $PS1 to something else. – Ben Jan 15 '18 at 20:30
  • ya @Ben, I got that. Thank you but it doesn't solve my issue. Let me put it in another way. I would like to see my terminal as shajhansi ~ but not as shajhansi (test #) ~ if that makes sense. – Shashi Jan 15 '18 at 20:43
  • Then you need to change your PS1 environment variable to something else, because it is currently configured to show you the branch you are currently on. – Ben Jan 15 '18 at 20:51
  • Okay! great. I will work on it. Thank you so much @Ben. You have been very helpful and I really appreciate your time. This is my first question on StackOverflow and I got 3 downvotes already and I haven't got a clue why. I feel like asking questions here bit intimidating rather than welcoming. – Shashi Jan 15 '18 at 21:03
  • Yeah I understand, don't let that discourage you from asking more questions in the future though. You were most likely downvoted because it is not clear -at all- what you are asking. The way you have it written, it sounds like you don't know how to change branches, but in reality, you have a question about how information is displayed on your prompt. Hope this helps you with what you're doing though! Good luck! – Ben Jan 15 '18 at 21:14
  • Cool. Apologies for downvoters, my bad. I'm just beginning to learn how StackOverflow is actually working, as I'm going through all, the do's and don'ts. I reframed my question now and I guess its bit relevant to the issue. Thank you for the encouragement and clarifying my doubts . @Ben – Shashi Jan 15 '18 at 21:27