Skip to content

Instantly share code, notes, and snippets.

@obar1
Created September 17, 2025 10:39
Show Gist options
  • Save obar1/85bc3a14e39ead8dc018faa2229469d3 to your computer and use it in GitHub Desktop.
Save obar1/85bc3a14e39ead8dc018faa2229469d3 to your computer and use it in GitHub Desktop.
rebase_with_git
export MY_BRANCH=feat/DC1121-7769

git switch $MY_BRANCH

if [ "$(git branch --show-current)" = "$MY_BRANCH" ]; then
  echo "✅ You are on branch: $MY_BRANCH"
else
  echo "❌ You are NOT on branch: $MY_BRANCH"
fi

git fetch origin

# Start interactive rebase against origin/main
git rebase -i origin/main
image

squash

echo ...
echo git push origin $MY_BRANCH --force-with-lease
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment