Skip to content

Instantly share code, notes, and snippets.

@KHCode
Last active April 16, 2024 21:40
Show Gist options
  • Save KHCode/7f9abd4d2afd7f3a00c58abfc8c3d0b0 to your computer and use it in GitHub Desktop.
Save KHCode/7f9abd4d2afd7f3a00c58abfc8c3d0b0 to your computer and use it in GitHub Desktop.
Git Recipes
----------- Rebasing onto common branch when working with others ----------------------------------------
git fetch origin develop:develop # instead of checkout develop, pull develop, checkout feature/...
git rebase develop
git push --force-with-lease
---------------------------------------------------------------------------------------------------------
----------- Pulling down a single file from the remote repo ---------------------------------------------
git checkout origin/develop -- path/to/filename
# Use this a lot when I run a migration from another dev's recent merge and I need to clean up the schema
---------------------------------------------------------------------------------------------------------
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment