Difference between revisions of "Git Hacks and Tricks"

From OPeNDAP Documentation
(Created page with "These are simple things that are not really obvious from the git book or other sources ;How to see a list of 'conflicted' files after a merge :git diff --name-only --diff-fil...")
 
m
Line 1: Line 1:
 +
== Git resources ==
 +
* The 'Pro git' book is online at: git.com
 +
* Good cheat sheet: http://ndpsoftware.com/git-cheatsheet.html#loc=workspace;
 +
* Info on branching from git.com: http://git-scm.com/book/en/Git-Branching-Remote-Branches
 +
* Migration to git: http://git-scm.com/book/en/Git-and-Other-Systems-Migrating-to-Git
 +
 +
== Setup a username and access token for GitHub ==
 +
 +
:git config --global github.user <name>
 +
:git config --global github.token <token>
 +
 +
:where the token is made using the instructions at https://help.github.com/articles/creating-an-access-token-for-command-line-use
 +
 +
== Cheat sheet items ==
 
These are simple things that are not really obvious from the git book or other sources
 
These are simple things that are not really obvious from the git book or other sources
  

Revision as of 23:20, 2 January 2015

1 Git resources

2 Setup a username and access token for GitHub

git config --global github.user <name>
git config --global github.token <token>
where the token is made using the instructions at https://help.github.com/articles/creating-an-access-token-for-command-line-use

3 Cheat sheet items

These are simple things that are not really obvious from the git book or other sources

How to see a list of 'conflicted' files after a merge
git diff --name-only --diff-filter=U
How to see the different remote branches
git remote show origin
How do I see what would be pushed to a remote repo?
git push --dry-run
git diff origin/master # Assumes you have run git fetch, I think
git diff --stat origin/master # --stat just shows the file names stats, not the diffs