Skip to content

Instantly share code, notes, and snippets.

@gauravkhuraana
Last active May 5, 2025 05:29
Show Gist options
  • Save gauravkhuraana/56ccc98257dbf9524f01d390cd92ad3d to your computer and use it in GitHub Desktop.
Save gauravkhuraana/56ccc98257dbf9524f01d390cd92ad3d to your computer and use it in GitHub Desktop.
Remove Unwanted Files from a PR
git checkout your-branch-name
git restore --source origin/main -- . ':!file1.txt' ':!folder/file2.cs' ':!src/file3.json'
git add .
git commit -m "Keep only selected files in PR"
git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment