<branch1>..<branch2> definition: 'All commits reachable by <branch2> that aren''t reachable by <branch1>.'
ety: ''
variants: ''

Commit An isolated change to source code.

git branch -f <branch> <commit> definition: 'Move (by force) the designated branch to the designated commit.'
ety: ''
variants: ''

git commit —amend Amend the most recent commit instead of creating a new commit.

git commit -m <message> definition: 'Add a message to a commit command.'
ety: ''
variants: ''

git diff —name-only <commit>^..<commit> List the files modified in a particular commit.

git log —name-only -1 <commit> List the files altered by the particular commit.

git log -p -1 <commit> Show the change made by a particular commit.

git log —pretty=oneline | grep <string> Find commit(s) with comments containing <string>.

git revert <commit> Revert an existing commit.

git rev-list List commit objects in reverse chronological order.

Facts, Thoughts and Opinions

Commiting files to git, best practice

  1. git status # Confirm that the stage doesn't contain files that you don't want to commit.
  2. git add <file> # Add the files to the stage.
  3. git diff -b —cached # Show the changes that are staged. Confirm that these differences, and only these differences, are what you want to put in the current commit.
  4. git commit


  •   Subtopics

  •   Writings

  Sources & Bookmarks

Name/Link Date