Skip to content

Instantly share code, notes, and snippets.

@gtallen1187
Last active November 6, 2020 10:29
Show Gist options
  • Save gtallen1187/37257abc3685d26b8149 to your computer and use it in GitHub Desktop.
Save gtallen1187/37257abc3685d26b8149 to your computer and use it in GitHub Desktop.
cool git features
## set local branch to track remote
## using `dev` branch as an example
git branch --set-upstream-to=origin/dev dev
## abort conflicted merge
git merge --abort
## removes trailing whitespace, collapses newlines
git stripspace < file.txt
## highlight bad whitespace in your own files
git diff --check
## shows diff for staged but uncommitted changes
git diff --cached
## fetch a pull request and bring it to your own local branch
git fetch origin pull/12/head:local-branch
## find all the repos that another user has starred on Github
https://github.com/stars/{user name}
## The single most beast-mode git command ever (requires defunkt/hub)
## creates a pull request from the command line, attaches the pull request to an issue, no fork required
git pull-request -i 349 -m "example location of imm date range in question" -b ecwdatascience:where-source-365 -h ecwdatascience:immunizations
@matthewplunkett
Copy link

i have verified that hub (1.12.1) is installed; once i navigate to local repo, should git browse -- issues allow me to view open issues or is there additional setup required? keeps returning git: 'browse' is not a git command. See 'git --help'. Did you mean this? web--browse

@gtallen1187
Copy link
Author

@matthewplunkett - did you make sure and alias hub as git? you need to do that first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment