# Git tips and tricks ## Setup name and email git config --global user.name "Name" git config --global user.email "name@place.com" ## Delete remote branch git push -d ## `git bisect` git bisect start git bisect new git checkout git bisect old git bisect run ## Patches git diff > change.patch patch -p1 < change.patch # -p1 to remove the a/ and b/ from filepaths ## Exporting a commit git archive Outputs to stdout a tar archive of the index at the given commit. Make a directory of just the code, not a repo: git archive | tar --extract --directory ## Remotes Change remote url: git remote set-url