-2

I opened a list of branches in the terminal(iTerm), and then I don't know how I can go to the current branch in the current situation.

enter image description here

UPD:

The problem is to get out of the list of these branches, that is, to close this editor

Morozov
  • 4,077
  • 3
  • 32
  • 56
  • 1
    You are in the current branch, right? The branch marked with an asterisk is your current branch. What exactly would you like to achieve? – zois Jan 23 '21 at 00:54
  • 2
    I *think* you intended to ask "how do I exit my pager". (The answer depends on which pager you're using.) See, e.g., [this related question](https://stackoverflow.com/q/59940755/1256452). – torek Jan 23 '21 at 02:46
  • @torek The pager on the screen is obviously `less` – phd Jan 23 '21 at 12:23
  • https://stackoverflow.com/q/48341920/7976758 – phd Jan 23 '21 at 12:24
  • 1
    @phd: I think it is `less` too, but by looking up how to *set* the pager as well as its options, the OP can change the pager if desired. :-) – torek Jan 24 '21 at 00:24

4 Answers4

3

To get out of this view in the terminal you just have to press q. It's as simple as that.

vveil
  • 165
  • 7
0

For what I understand, you are in "dev" branch, this is your current branch, marked by "*".

If you want to switch to another branch you can type:

git checkout master // master or other existing branch

If you want to create another branch:

git branch newBranch

You can find more about these branch related commands on the official documents of git here: git checkout git branching

EDIT: If you are trying to quit the branch listing window on the terminal, I suppose you would use the cmd + Q command for that. iTerm2 doc

Marcus Castanho
  • 145
  • 1
  • 3
  • 9
  • yes, i am trying to quit the branch listing window on the terminal and cmd + Q doesn't work for me. – Morozov Jan 27 '21 at 14:17
0

When you list all branches using git branch it will display local branches when you run git branch -a it will display local as well as remote branches. Now if you want to switch branch you have to use this command.

git checkout branch-name

In your case, you are already at dev branch just run git checkout master to switch to master

Extra: If you want to create a new branch just run git checkout -b branch-name. This will create new branch and switch to it as well.

Hadi Mir
  • 3,437
  • 2
  • 22
  • 28
0

You can do git checkout like

git checkout

To go on particular branch.

If you want to know your current branch, then you can see that in round bracket.

Or else you can fire command like git branch. This will list down all the branches in repository. And the one which is in green color, that is your current branch.

Refer this video to get fair idea about version control system and to understand the basics of GIT.

https://youtu.be/et_KFeBad28

Mark
  • 1