Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Option to Specify Repository Branch #4

Open
teles opened this issue Dec 2, 2024 · 0 comments · May be fixed by #7
Open

Add Option to Specify Repository Branch #4

teles opened this issue Dec 2, 2024 · 0 comments · May be fixed by #7

Comments

@teles
Copy link

teles commented Dec 2, 2024

Currently, git2txt defaults to the repository’s default branch when converting its contents into a text file. However, many repositories maintain multiple branches (e.g., develop, feature/, release/) that users might want to analyze or document separately. The ability to specify a branch would provide greater flexibility and control over which version of the repository is processed.


Introduce a new command-line option (e.g., --branch or -b) that allows users to specify the branch they wish to convert. For example:

git2txt username/repository --branch=develop

Proposed Option Details:

  • Option Name: --branch or -b
  • Description: Specifies the branch of the repository to use for conversion.
  • Default Behavior: If the option is not provided, the tool will continue to use the repository’s default branch.
# Specify the 'develop' branch
git2txt username/repository --branch=develop

# Using the short flag
git2txt username/repository -b feature/new-feature

Benefits:

  • Flexibility: Users can choose which branch to convert, enabling analysis of different development stages.
  • Efficiency: Facilitates working with repositories that have active development on multiple branches without needing to switch branches manually.
  • Enhanced Functionality: Aligns git2txt with common Git workflows, making it more versatile for various use cases.
killerwolf added a commit to killerwolf/git2txt that referenced this issue Dec 11, 2024
@killerwolf killerwolf linked a pull request Dec 11, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant