Skip to content

m1st0/Git-Auto-Checkout-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 

Repository files navigation

Git-Auto-Checkout-Script

This Zsh script automates the process of checking out the most recent version of a Git repository. It intelligently determines the correct branch or tag to use, saving you time and ensuring you are always working with the latest code. Addtional scripts will be added as possible.

If you find this project useful and would like to support its development, consider donating via PayPal or Venmo: PayPal. Venmo

© 2025 Maulik Mistry

This project is licensed under the Apache License, Version 2.0. A full copy of the license can be found at LICENSE.txt or http://www.apache.org/licenses/LICENSE-2.0.


Features

  • Smart Remote Detection: Automatically detects your remote name (e.g., origin, upstream, or a custom name like your Git username) to ensure it works across different repository setups.

  • Latest Release Checkout: Prioritizes checking out the latest release/ branch.

  • Latest Tag Fallback: If no release/ branch is found, it falls back to the absolute latest version tag (e.g., v2.12.0).

  • Default Branch Fallback: As a final option, it checks out the repository's default branch (e.g., main or master).

  • Safety Checks: Warns you if you have uncommitted changes to prevent work from being overwritten.

  • Specific Tag Support: Allows you to specify a tag as an argument to check out a particular version.


Usage

  1. Make the script executable if needed:

    chmod +x ./git_checkout_latest.zsh
  2. Run the script without arguments in a local git repository with a remote already set: This will automatically find and check out the latest stable version.

    ./git_checkout_latest.zsh
  3. Run the script with a specific tag: This will check out the exact tag you specify, if it exists.

    ./git_checkout_latest.zsh v1.0.0

About

Automates the process of intelligently checking out the most recent version of a Git repository.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages