How to get a list of git branches in a Rails application?

Can I get a list of branches in a Rails application? I need to access the branch list of a specific git repository (not the repository of my application) in my application. So maybe some kind of stone exists for this?

+4
source share
3 answers

The easiest way is to simply use git branch commands for different options. -a shows all local and remote branches, and -r shows only remote branches.

$ git branch
* master

$ git branch -a
* master
 origin/1-2-stable
 origin/2-0-stable
 origin/2-1-stable
 origin/2-2-stable
 origin/3-0-unstable
 origin/HEAD
 origin/master

$ git branch -r
 origin/1-2-stable
 origin/2-0-stable
 origin/2-1-stable
 origin/2-2-stable
 origin/3-0-unstable
 origin/HEAD
 origin/master
+4
source

git branch --all and git branch -a , they are both the same, this command will display all branches.

$ git branch --all
asset_pipeline_changes
live
* master
secondary_menu
remotes/origin/master
+2
source
**git branch -a** 

,

**git branch -r** 

.

0

Source: https://habr.com/ru/post/1534360/


All Articles