<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-GB">
	<id>https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Git_-_Working_Locally</id>
	<title>Git - Working Locally - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://training-course-material.com/index.php?action=history&amp;feed=atom&amp;title=Git_-_Working_Locally"/>
	<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;action=history"/>
	<updated>2026-04-30T09:15:48Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.45.1</generator>
	<entry>
		<id>https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=88486&amp;oldid=prev</id>
		<title>Lsokolowski1: /* File Status */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=88486&amp;oldid=prev"/>
		<updated>2025-01-23T15:48:09Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;File Status&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:48, 23 January 2025&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l35&quot;&gt;Line 35:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 35:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== File Status ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== File Status ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;https://docs.google.com/drawings/pub?id=1Fp1iYscfMixvIWduFJMejQzmdDmPsvXt3QS3kQ7WSnE&amp;amp;w=800&amp;amp;h=600&amp;amp;.png&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;!-- &lt;/ins&gt;https://docs.google.com/drawings/pub?id=1Fp1iYscfMixvIWduFJMejQzmdDmPsvXt3QS3kQ7WSnE&amp;amp;w=800&amp;amp;h=600&amp;amp;.png &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;--&amp;gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;[[File:GitFileStatLifecyc.png]]&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Committing new files and changes ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Committing new files and changes ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lsokolowski1</name></author>
	</entry>
	<entry>
		<id>https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=87744&amp;oldid=prev</id>
		<title>Lsokolowski1: /* Undoing Changes */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=87744&amp;oldid=prev"/>
		<updated>2023-11-08T14:08:04Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Undoing Changes&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en-GB&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 14:08, 8 November 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l178&quot;&gt;Line 178:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 178:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Undoing Changes ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Undoing Changes ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  git checkout &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;--        &lt;/del&gt;# Remove not staged changes &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;and &lt;/del&gt;local copy&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  git checkout &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;.         &lt;/ins&gt;# Remove not staged changes &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;in &lt;/ins&gt;local copy&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  git reset HEAD         # Remove changes from cache but leaves local copy intact&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;  git reset HEAD         # Remove changes from cache but leaves local copy intact&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; git restore &amp;lt;path&amp;gt;     # Same as checkout, EXPERIMENTAL command (atm 11.2023)&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Amending latest commit ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Amending latest commit ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Lsokolowski1</name></author>
	</entry>
	<entry>
		<id>https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=45712&amp;oldid=prev</id>
		<title>Łukasz Sokołowski: /* Amending latest commit */</title>
		<link rel="alternate" type="text/html" href="https://training-course-material.com/index.php?title=Git_-_Working_Locally&amp;diff=45712&amp;oldid=prev"/>
		<updated>2016-11-07T16:02:47Z</updated>

		<summary type="html">&lt;p&gt;&lt;span class=&quot;autocomment&quot;&gt;Amending latest commit&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Git|020]]&lt;br /&gt;
&lt;br /&gt;
== Git Locally ==&lt;br /&gt;
* Git as an extension to the file system&lt;br /&gt;
* No network required&lt;br /&gt;
* Repository deleted if &amp;#039;&amp;#039;.git&amp;#039;&amp;#039; folder is deleted&lt;br /&gt;
&lt;br /&gt;
== Initializing a repository for existing files ==&lt;br /&gt;
 git init&lt;br /&gt;
 git add .&lt;br /&gt;
 git commit&lt;br /&gt;
&lt;br /&gt;
== Setting Up Username ==&lt;br /&gt;
 git config --global user.name &amp;quot;Bernard&amp;quot;&lt;br /&gt;
 git config --global user.email b@noblepog.com&lt;br /&gt;
&lt;br /&gt;
== Browsing Repository ==&lt;br /&gt;
 git show rev:file &lt;br /&gt;
 git show rev:directory  &lt;br /&gt;
 git show rev&lt;br /&gt;
&lt;br /&gt;
== Basic Commands ==&lt;br /&gt;
 git add file   &lt;br /&gt;
 git rm file &lt;br /&gt;
 git mv file&lt;br /&gt;
&lt;br /&gt;
== Moving Files ==&lt;br /&gt;
 git mv afile.txt movedfile.txt&lt;br /&gt;
 &lt;br /&gt;
 # equivalent to&lt;br /&gt;
 &lt;br /&gt;
 mv afile.txt movedfile.txt&lt;br /&gt;
 git rm afile.txt&lt;br /&gt;
 git add movedfile.txt&lt;br /&gt;
&lt;br /&gt;
== File Status ==&lt;br /&gt;
https://docs.google.com/drawings/pub?id=1Fp1iYscfMixvIWduFJMejQzmdDmPsvXt3QS3kQ7WSnE&amp;amp;w=800&amp;amp;h=600&amp;amp;.png&lt;br /&gt;
&lt;br /&gt;
== Committing new files and changes ==&lt;br /&gt;
 # Commiting new files&lt;br /&gt;
 git add newfile.txt&lt;br /&gt;
 git commit&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 # Changes&lt;br /&gt;
 echo new line &amp;gt;&amp;gt; afile.txt&lt;br /&gt;
 git add afile.txt&lt;br /&gt;
 git commit&lt;br /&gt;
&lt;br /&gt;
 or  &lt;br /&gt;
&lt;br /&gt;
 echo new line &amp;gt;&amp;gt; afile.txt&lt;br /&gt;
 git commit -a &lt;br /&gt;
 &lt;br /&gt;
[[File:Git-commit-a1.png|250px]] [[File:Git-commit-a2.png|250px]]&lt;br /&gt;
&lt;br /&gt;
== Committing Folders ==&lt;br /&gt;
 mkdir afolder&lt;br /&gt;
 touch afolder/file1.txt&lt;br /&gt;
 touch afolder/file2.txt&lt;br /&gt;
 git add afolder&lt;br /&gt;
 git commit&lt;br /&gt;
&lt;br /&gt;
== Empty Folders ==&lt;br /&gt;
 mkdir emptyfolder&lt;br /&gt;
 git add emptyfolder&lt;br /&gt;
 git commit &lt;br /&gt;
 # Nothing to commit&lt;br /&gt;
&lt;br /&gt;
 #Workaround&lt;br /&gt;
 touch emptyfolder/.gitignore&lt;br /&gt;
 git add emptyfolder/.gitignore&lt;br /&gt;
 git commit&lt;br /&gt;
 #Worked&lt;br /&gt;
&lt;br /&gt;
== Exercises ==&lt;br /&gt;
&lt;br /&gt;
1. Create a file structure&lt;br /&gt;
 sudo mkdir /rcs&lt;br /&gt;
 sudo chmod 777 /rcs &lt;br /&gt;
 mkdir /rcs/repo&lt;br /&gt;
 cd /rcs/repo&lt;br /&gt;
 echo first line &amp;gt; afile.txt&lt;br /&gt;
2. Initialize repository&lt;br /&gt;
&lt;br /&gt;
3. Stage the file&lt;br /&gt;
&lt;br /&gt;
4. Check whether the file has been staged&lt;br /&gt;
&lt;br /&gt;
5. Commit the changes&lt;br /&gt;
&lt;br /&gt;
6. Check whether the files have been committed&lt;br /&gt;
&lt;br /&gt;
7. What is the SHA1 of the commit?&lt;br /&gt;
&lt;br /&gt;
== Tracking Changes ==&lt;br /&gt;
 git status&lt;br /&gt;
 git diff&lt;br /&gt;
 git diff rev path&lt;br /&gt;
 git show&lt;br /&gt;
&lt;br /&gt;
== Diff ==&lt;br /&gt;
&lt;br /&gt;
https://docs.google.com/drawings/pub?id=1_elrohhhWPx8aIqYYZS4D-8Y54VDp_-reloS37NW91A&amp;amp;w=800&amp;amp;h=300&amp;amp;.png&lt;br /&gt;
&lt;br /&gt;
== Diff Examples ==&lt;br /&gt;
&lt;br /&gt;
 echo Commited Changes &amp;gt;&amp;gt; afile.txt &lt;br /&gt;
 git commit -a -m &amp;quot;asdf&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
 echo Staged Changes &amp;gt;&amp;gt; afile.txt &lt;br /&gt;
 git add afile.txt&lt;br /&gt;
 &lt;br /&gt;
 echo Not-tracked Changes &amp;gt;&amp;gt; afile.txt &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;git diff&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;command-results&amp;quot;&amp;gt;&lt;br /&gt;
 [master c81907a] Commited changes&lt;br /&gt;
  1 file changed, 1 insertion(+)&lt;br /&gt;
 diff --git a/afile.txt b/afile.txt&lt;br /&gt;
 index fc321d0..978da6e 100644&lt;br /&gt;
 --- a/afile.txt&lt;br /&gt;
 +++ b/afile.txt&lt;br /&gt;
 @@ -1,3 +1,4 @@&lt;br /&gt;
  first line&lt;br /&gt;
  Commited Changes&lt;br /&gt;
  Staged Changes&lt;br /&gt;
 +Not-tracked Changes&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;git diff --cached&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;command-results&amp;quot;&amp;gt;&lt;br /&gt;
 diff --git a/afile.txt b/afile.txt&lt;br /&gt;
 index 37a8835..fc321d0 100644&lt;br /&gt;
 --- a/afile.txt&lt;br /&gt;
 +++ b/afile.txt&lt;br /&gt;
 @@ -1,2 +1,3 @@&lt;br /&gt;
  first line&lt;br /&gt;
  Commited Changes&lt;br /&gt;
 +Staged Changes&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;git diff HEAD&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;command-results&amp;quot;&amp;gt;&lt;br /&gt;
 diff --git a/afile.txt b/afile.txt&lt;br /&gt;
 index 37a8835..978da6e 100644&lt;br /&gt;
 --- a/afile.txt&lt;br /&gt;
 +++ b/afile.txt&lt;br /&gt;
 @@ -1,2 +1,4 @@&lt;br /&gt;
  first line&lt;br /&gt;
  Commited Changes&lt;br /&gt;
 +Staged Changes&lt;br /&gt;
 +Not-tracked Changes&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;git diff HEAD^&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;div class=&amp;quot;command-results&amp;quot;&amp;gt;&lt;br /&gt;
 diff --git a/afile.txt b/afile.txt&lt;br /&gt;
 index 08fe272..978da6e 100644&lt;br /&gt;
 --- a/afile.txt&lt;br /&gt;
 +++ b/afile.txt&lt;br /&gt;
 @@ -1 +1,4 @@&lt;br /&gt;
  first line&lt;br /&gt;
 +Commited Changes&lt;br /&gt;
 +Staged Changes&lt;br /&gt;
 +Not-tracked Changes&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Who fixed (spoiled) it? - git annotate ==&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;git annotate afile.txt&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 03be4dec        (   Bernard     2012-09-02 14:53:27 +0200       1)first line&lt;br /&gt;
 c81907a9        (   Bernard     2012-09-02 16:50:24 +0200       2)Commited Changes&lt;br /&gt;
 00000000        (Not Committed Yet      2012-09-02 17:08:44 +0200       3)Staged Changes&lt;br /&gt;
 00000000        (Not Committed Yet      2012-09-02 17:08:44 +0200       4)Not-tracked Changes&lt;br /&gt;
&lt;br /&gt;
== Undoing Changes ==&lt;br /&gt;
 git checkout --        # Remove not staged changes and local copy&lt;br /&gt;
 git reset HEAD         # Remove changes from cache but leaves local copy intact&lt;br /&gt;
&lt;br /&gt;
== Amending latest commit ==&lt;br /&gt;
You can amend your latest commit (re-edit the metadata as well as update the tree)&lt;br /&gt;
 git commit --amend&lt;br /&gt;
To toss your latest commit away completely&lt;br /&gt;
&amp;lt;!-- git reset HEAD^&lt;br /&gt;
this will not change the working tree.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Exercise (Index) ==&lt;br /&gt;
# Add the new line to afile.txt&lt;br /&gt;
# Check the difference between index and the file&lt;br /&gt;
# Add the file&lt;br /&gt;
# Check the difference between repository and the staging&lt;br /&gt;
# Revert all not committed changes to the file (the file should be the same as in the repo)&lt;br /&gt;
# Add new line to a file&lt;br /&gt;
# Commit the changes&lt;br /&gt;
&lt;br /&gt;
== Reverting with New Commit ==&lt;br /&gt;
Revert the most recent commit:&lt;br /&gt;
 git revert HEAD&lt;br /&gt;
This will create a new commit which undoes the change in HEAD. &lt;br /&gt;
&lt;br /&gt;
Other example:&lt;br /&gt;
 git revert HEAD^&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Exercise (git revert) ==&lt;br /&gt;
# Add the line “bad changes” to afile.txt&lt;br /&gt;
# Commit your changes&lt;br /&gt;
# Use git revert to remove&lt;br /&gt;
&lt;br /&gt;
== Cleaning Untracked Files ==&lt;br /&gt;
 touch untrackedfile.txt&lt;br /&gt;
 git status&lt;br /&gt;
 echo untrackedfile.txt &amp;gt; .gitignore&lt;br /&gt;
 git status&lt;br /&gt;
&lt;br /&gt;
 git clean -n&lt;br /&gt;
 git clean -f&lt;br /&gt;
&lt;br /&gt;
== .gitignore syntax ==&lt;br /&gt;
Lines starting with &amp;#039;#&amp;#039; are considered comments.&lt;br /&gt;
 # Ignore any file named foo.txt.&lt;br /&gt;
 foo.txt&lt;br /&gt;
 # Ignore (generated) html files,&lt;br /&gt;
 *.html&lt;br /&gt;
 # except foo.html which is maintained by hand.&lt;br /&gt;
 !foo.html&lt;br /&gt;
 # Ignore objects and archives.&lt;br /&gt;
 *.[oa]&lt;br /&gt;
&lt;br /&gt;
== gitignore vs excludes ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;.gitignore&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* version-controlled&lt;br /&gt;
* distributed to other repositories via clone (i.e., files that all developers will want to ignore)&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;$GIT_DIR/info/exclude&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* specific to a particular repository but which do not need to be shared with other related repositories (e.g., auxiliary files that live inside the repository but are specific to one user’s workflow)&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;~/.gitconfig (core.excludesfile)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice)&lt;br /&gt;
&lt;br /&gt;
== Exercise ==&lt;br /&gt;
* echo something &amp;gt; Thumb.db&lt;br /&gt;
* Add Thumb.db file to .gitignore&lt;br /&gt;
* Add .gitignore to the repository and commit&lt;br /&gt;
* Check whether Thumb.db is ignored in afolder&lt;br /&gt;
* Clone the repo to /rcs/repoclone&lt;br /&gt;
* Check whether the Thumb.db is ignored there&lt;br /&gt;
&lt;br /&gt;
== Browsing Repo ==&lt;br /&gt;
 gitk&lt;br /&gt;
 git gui&lt;br /&gt;
 git log&lt;br /&gt;
 git show &lt;br /&gt;
 git show HEAD:afolder&lt;br /&gt;
 git show HEAD:afile&lt;br /&gt;
 git show commit (can be tag or branch)&lt;br /&gt;
  git show HEAD^&lt;br /&gt;
  git show master&lt;br /&gt;
  git show c01a0d43&lt;br /&gt;
&lt;br /&gt;
== TIG ==&lt;br /&gt;
Press h to view more options!&lt;br /&gt;
&lt;br /&gt;
[[File:Git-tig.png|500px]]&lt;/div&gt;</summary>
		<author><name>Łukasz Sokołowski</name></author>
	</entry>
</feed>