Giter VIP home page Giter VIP logo

git_pull's Introduction

Git Pull Script (uses only standard libraries)

This is a Python script for automating the git pull command in multiple Git repositories located within a specified folder. It recursively searches for Git repositories in subdirectories of the provided folder and performs a git pull operation in each repository.

Prerequisites

  • Python 3.10 or higher installed on your system
  • Git installed on your system and available in your system's PATH

Usage

$ python git_pull.py [-h] [-p PATH]
  • -h, --help: Show help message and exit.
  • -p, --path: Optional. Specify the path to the folder containing Git repositories for which git pull needs to be performed. If not provided, the current working directory will be used as the default path.

Example

$ python git_pull.py -p /path/to/repositories

This will search for Git repositories in the specified folder (/path/to/repositories) and its subdirectories, and perform a git pull operation in each repository to fetch and merge the latest changes from the remote repository.

Note

  • If a Git repository has uncommitted changes or there are conflicts while pulling, the script will not perform the pull operation for that repository.
  • The script uses the git rev-parse command to determine the top-level directory of a Git repository, and then performs the git pull operation in that directory.
  • The script prints the output of git pull command for each repository to the console, including any error messages or conflicts encountered during the pull operation.
  • The script has a timeout of 10 seconds for each git pull operation. If the operation exceeds this timeout, the script will forcefully terminate the process and print the output to the console.

Disclaimer

Use this script at your own risk. It is always recommended to backup your repositories before performing any automated operations. The script may have unintended consequences or cause data loss if not used correctly. The script author is not responsible for any damages or loss incurred through the use of this script.

git_pull's People

Contributors

pavel-hushcha avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.