Samstag, 23. Februar 2013

Print current branch of each project

When you are working on/with Android AOSP you are working with many projects and repositories having all their different bases and probably also different branches or tags.If you are doing your changes, generally you create a new branch, do your modifications, commit your changes, probably revert or switch to a different branch,execute the repo sync command and so on.
For me it happens often, that I do not exactly know, which project is currently checked out on which branch. If you are working on one single project, it's not a big problem. You execute
git branch
in the current working directory and you will get the info immediately. Working and switching between several projects, it's a pain to do it in that way. For that situation I wrote a small script which is doing that for all my projects:
while read line; do (cd $line; echo $line "`git branch`";) done <.repo/project.list

Creating a small shell script with the content shown above I can execute that script from the base directory of my projects and I am getting a full overview of the current status.

Keine Kommentare:

Kommentar veröffentlichen