How to obtain a patch from a GitHub commit?
By appending .patch to the commit URL, a commit can easily be downloaded as patch. (Details)
How to obtain a patch from a GitHub pull request?
How to undo the last commit?
To nuke the last commit:
To edit the last commit:
How to modify a commit?
Using the "edit" option of the interactive rebase allows additional modification to that commit. Use
git rebase -i HEAD~3 where the number in HEAD~3 indicates how many commits back the interactive rebasing should go. See Fixing a commit via interactive rebase edit for detailed step-by-step example.
Why not to edit the original branch (edit master or rice-2.5 branch)?
It is recommended to do changes in a fix branch (normally named after the JIRA id). This makes it easier to work on multiple issues at the same time.
For example you are working on feature A, commit that to master as feature-A-commit, and create a pull request. While your pull request is outstanding your personal rice repository is one commit ahead of kuali:master. If you were to branch your master then feature-A-commit is included on that branch and that commit will be included in any further pull request that is created. In essence your feature B work would have feature-A-commit as well as feature-B-commit which is not what we want. You'd manually would have to remove the feature-A-commit before creating the pull request for feature B.
Ignoring IntelliJ configuration file changes
Note, some of these commands need to be done in a shell, so on windows use Git Bash.
Locate the commit at which the tag should be placed. For releases it's the commit that changes the version number to the released version e.g. https://github.com/kuali/rice/commit/076c861a35c2120e55de06b55e9030ce7d5584ec .
Preventing accidental pushes
If you want prevent yourself from pushing changes back to a repo that you have cloned you can use the following command
which will cause and error on push.
git remote -v will look like:
origin DISALLOWED (push)
Resetting local branch match upstream exactly
To discard everything and start anew on a branch run the following commands: