Skip to content

Instantly share code, notes, and snippets.

@CypherpunkSamurai
Created February 26, 2022 06:41
Show Gist options
  • Select an option

  • Save CypherpunkSamurai/be805aa762cd4bb2ac3d0dca48e0fb04 to your computer and use it in GitHub Desktop.

Select an option

Save CypherpunkSamurai/be805aa762cd4bb2ac3d0dca48e0fb04 to your computer and use it in GitHub Desktop.
Diff Local Repo to Remote Repo
# add the remote
git remote add b https://remote_repo.git
# fetch remote commits
git remote update
# uses current branch for diffing
git diff $(git branch --show-current) remotes/b/remote_repo_branch > diff.diff\
# remove the remote for cleanup
git remote rm b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment