Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions 26 gitbootcamp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,32 @@ Commit the files:

git commit -m "<message>"

.. _diff-changes:

Comparing Changes
-----------------

View all non-commited changes::

git diff

Compare to the ``main`` branch::

git diff main

Exclude generated files from diff using an ``attr``
`pathspec <https://git-scm.com/docs/gitglossary#def_pathspec>`_ (note the
single quotes)::

git diff main ':(attr:!generated)'

Exclude generated files from diff by default::

git config diff.generated.binary true

Comment thread
erlend-aasland marked this conversation as resolved.
The ``generated`` `attribute <https://git-scm.com/docs/gitattributes>`_ is
defined in :file:`.gitattributes`, found in the repository root.

.. _push-changes:

Pushing Changes
Expand Down
Morty Proxy This is a proxified and sanitized view of the page, visit original site.