tj / tj/git-extras

list/checkout recently used branches

Open
#747 3 comments 6 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

feature
Dominant language
Shell
Stars
18.1k
Forks
1.2k
Avg merge
5d 17h
Merged PRs (30d)
1

Description

Hi. I have a little script that parse git reflog to look for recently used branches.
It's similar to git checkout @{-n} but more user-friendly.

For example,

(nao) mgaitan@morochita:~/nao$ git recent-branches 
1 - feature/PSO-20131-refactor-to-avoid-package-s-interdependency
2 - feature/PSO-20723-include-ut_utils-only-in-development-installations
3 - feature/PSO-20130-move-model-s-related-tests
4 - develop
5 - develop_fixed
6 - master
7 - 48b39f6e31d0181af828fe2b660fc109d4aeb9d4
8 - master_fixed
9 - feature/PSO-20130-move-model-s-related-tests__

(nao) mgaitan@morochita:~/nao$ git recent-branches 2
Switched to branch 'feature/PSO-20723-include-ut_utils-only-in-development-installations'
Your branch is up-to-date with 'origin/feature/PSO-20723-include-ut_utils-only-in-development-installations'.

Here is my implementation, in python
https://gist.github.com/mgaitan/ba1e4e252b90a7fd4a4eb9e1742e94fb

Could it be useful in this package? I could rewrite it in bash, if it was needed.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing git-extras command structure and the linked Python implementation, then inspect how git reflog and checkout are invoked. The finished command should list recently used branches and accept a numeric selection that checks out the corresponding entry, matching the examples in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
git, python, shell
Domain
cli, tooling
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.