Skip to main content

Efficiently clone and pull multiple Git repositories.

Project description

Batchfetch - Efficiently clone or pull multiple Git repositories in parallel

Introduction

Batchfetch is a command-line tool designed to clone, fetch, and merge multiple Git repositories simultaneously.

With Batchfetch, you no longer need to manually manage each repository one by one. It automates the tedious aspects of repository management, freeing you up to focus on what truly matters: your workflow.

Batchfetch is ideal for quickly cloning or pulling multiple Git repositories. It is also useful for cloning various addons, such as Vim plugins, Emacs packages, Ansible roles, Ansible collections, and other addons available on websites like GitHub, Codeberg, and GitLab.

Features:

  • Git Clone and Fetch/Merge: Clones the repositories and their submodules, ensuring that all the repositories are always up-to-date by fetching and merging changes.
  • Parallel Operations: Utilizes threads to simultaneously Git clone or pull multiple repositories, dramatically reducing wait times.
  • User-Friendly Interface: Provides simple and straightforward command-line options that make it easy to get started and effectively manage your repositories.
  • Custom Configuration: Allows the use of a YAML configuration file to specify and manage the repositories you interact with, enabling repeatable setups and consistent environments.

Installation

pip install --user batchfetch

The pip command above will install the batchfetch executable in the directory ~/.local/bin/.

Example

Here is an example of a batchfetch.yaml file:

---

tasks:
  # Clone the default branch of the general.el repository to the
  # './general.el' directory
  - git: https://github.com/noctuid/general.el

  # Clone the tag 1.5 of the consult repository to the './consult'
  # directory
  - git: https://github.com/minad/consult
    revision: "1.5"

  # Clone the s.el repository to the './another-name.el' directory
  - git: https://github.com/magnars/s.el
    path: another-name.el
    revision: dda84d38fffdaf0c9b12837b504b402af910d01d

  # Delete './impatient-mode'
  - git: https://github.com/skeeto/impatient-mode
    delete: true

Execute the batchfetch command from the same directory as batchfetch.yml to make it clone or update the local copies of the repositories above.

Usage

Here are the various options that batchfetch provides, along with descriptions of their usage:

usage: batchfetch [--option] [args]

Command line interface.

positional arguments:
  N                     Specify the batchfetch YAML file(s) (default: './batchfetch.yaml').

options:
  -h, --help            show this help message and exit
  -j JOBS, --jobs JOBS  Run up to N Number of parallel processes (Default: 5).
  -v, --verbose         Enable verbose mode.

Frequently Asked Questions

What are untracked files?

The parent directory of the "path:" value defines the managed directory, where the directory of each path is considered as the managed directory.

For example, if the "path:" value is file/my-project, the managed directory will be file/. Any file within file/ that is not managed by batchfetch will be considered an untracked file.

When batchfetch encounters an untracked file, it displays an error message to inform users about paths that are not managed by the system. The message provides clear instructions on how to handle these paths by adding them to the options.ignore_untracked_paths list, enabling users to manage untracked files effectively.

Here is an example of a batchfetch.yaml file that enables batchfetch to accept a list of untracked files:

options:
  ignore_untracked_paths:
    - ./test
    - /absolute/path
    - ../relative/path

tasks:
  - git: https://github.com/user/project

By default, batchfetch.yaml is the only untracked file that is ignored. The user does not need to add it to the ignore_untracked_paths option.

License

Copyright (C) 2024 James Cherti

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program.

Links

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

batchfetch-1.2.6.tar.gz (26.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

batchfetch-1.2.6-py3-none-any.whl (28.3 kB view details)

Uploaded Python 3

File details

Details for the file batchfetch-1.2.6.tar.gz.

File metadata

  • Download URL: batchfetch-1.2.6.tar.gz
  • Upload date:
  • Size: 26.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for batchfetch-1.2.6.tar.gz
Algorithm Hash digest
SHA256 98c273f79db591a038aec59b065068b7da05245af6f86111c0c3e98c419ca0d5
MD5 403f848888c66f073459914de9a9f36d
BLAKE2b-256 cf7f1b278a96202b3bee5fb01480acefb270ffc291aa48b5c389e53a48c5e519

See more details on using hashes here.

File details

Details for the file batchfetch-1.2.6-py3-none-any.whl.

File metadata

  • Download URL: batchfetch-1.2.6-py3-none-any.whl
  • Upload date:
  • Size: 28.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.2

File hashes

Hashes for batchfetch-1.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9291e9a153b2c43e06117346bf7528f8003f58f08f694b6b69809a7564427439
MD5 ed1e507434752fdd077a425bfb4c828b
BLAKE2b-256 5038bfb6f4b67c91c812e9ea13c55bdc8c23b5b01f2957e6cfcd08fce70efbc9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page