Skip to content

Instantly share code, notes, and snippets.

@MakowskiHubert
MakowskiHubert / pre-commit-hook-merge-conflicts.sh
Created June 10, 2022 14:53 — forked from maxmarkus/pre-commit-hook-merge-conflicts.sh
Git pre-commit hook to prevent checking in non-resolved merge conflicts.
#!/bin/bash
# Check for merge conflicts
# Tested on Linux and Mac
# Simple check for merge conflics
conflicts=`git diff --cached --name-only -G"<<<<<|=====|>>>>>"`
@MakowskiHubert
MakowskiHubert / gist:aeca7b9489005fd7d9ef68256aef30f4
Created June 7, 2022 08:02 — forked from stuart11n/gist:9628955
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote