Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 15 Next »

Git commandWhy is it useful?
git merge-base --fork-point masterWhile on your development branch, when you type this command, it will return the hash of the commit which was the 'fork point' for your development branch, i.e - the commit from which you first created your development branch.

git config commit.gpgsign true

(Git v2.0+ only) Want to get rid of the hassle of having to remember to sign your commit? This will automatically sign your commits, all the time once you have set up GPG signature for your git repository.
git config --global credential.helper storeTired of entering your Github username and password every single time you make a push ? You can use this command after you enter login details once and git will store your credentials for you so that the next time onwards you wouldn't have to enter your login credentials again.
git mergetoolThis will launch a merge tool which you can use to resolve a merge conflict. You can configure your own merge tool (see the next pair of commands) or let git choose a default.

git config --global merge.tool <program>

git config --global mergetool.<program>.path <path/to/program>

These two commands can be used to configure a custom merge tool (like p4merge) which will then be used by default by commands like "git mergetool" and "git difftool"
git difftool <hash1> <hash2>This will launch the program configured via merge.tool to perform the git diff operation.
git add -uThis will stage only the files which were modified or deleted. So, if there are un-tracked files, they won't get added (unlike "git add ." which stages everything)
Git TipWhy is it useful?
To ignore whitespace in a Git diff: add ?w=1 to the URL

Find this and other GitHub secrets at https://github.com/blog/967-github-secrets

Push changes to your fork... often.If you accidentally trash your local repo, all is not lost.

Always update your branch via the rebase route.  Never use the "Update Branch" button on GitHub.

Whenever your branch is out of date, there's a button that appears on your PR on Github saying "Update Branch" which tempts you to bring your branch up to date with master with the click of a button. Well, please don't give in to the temptation, that button will create a merge commit, which is not signed, both of which are forbidden. So, always update your branch via the painful, rebase route.
When reviewing new files larger than 1500 lines, put each comment with its line number into one large comment in the pull request.

Bhroam has been bitten twice by large GitHub reviews.  In both cases he was reviewing new files that were larger than 1500 lines.  Any comment that he gave after line 1500 showed up at line 1500. 





Site Map

Developer Guide Pages



  • No labels