uaveiro-leci/tools/git-tools
Tiago Garcia 3ddccd5f70
[TOOLS] Added git-safe-push
2023-06-01 22:26:50 +01:00
..
README.md [TOOLS] Added git-safe-push 2023-06-01 22:26:50 +01:00
git-safe-push [TOOLS] Added git-safe-push 2023-06-01 22:26:50 +01:00

README.md

git-safe-push

Description

This script is used to push the local changes to the remote repository safely. Instead of pushing directly into the main branch, creates a temporary branch that can be safely deleted after the changes are reviewed and merged. This way you don't have to keep many branches in your remote repository which means it's easier to keep a linear commit history (Squash and Merge suggested for this aswell).

Usage

Download the script and then add it to bin with the following commands:

sudo mv git-safe-push /usr/bin
sudo chmod +x /usr/bin/git-safe-push

Then you can use it like this:

git safe-push <remote> <branch> <-n|-e>
  • <remote>: The remote repository to push to.
  • <branch>: The branch to push to.
  • -n: Pushes to a new branch.
  • -e: Pushes to an existing branch.