Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Sunday's post on reverting files, sprucing up the site a bit

  • Loading branch information...
commit abd8980ea325804538a3693b1f50c70de47f5e4f 1 parent 3827de3
@qrush qrush authored
View
4 _layouts/default.html
@@ -22,9 +22,11 @@
{{ content }}
</div>
<div class="sidebar">
+ <h3 id="purple"><a href="/">home</a></h3>
<h3 id="green">beginner</h3>
<div>
<a href="/2009/01/10/stashing-your-changes.html">stashing your changes</a>
+ <a href="/2009/01/11/reverting-files.html">reverting files</a>
{% for post in site.categories.beginner %}
<a href="{{ post.url }}">{{ post.title }}</a>
{% endfor %}
@@ -38,6 +40,7 @@ <h3 id="yellow">intermediate</h3>
</div>
<h3 id="red">advanced</h3>
<div>
+ <a href="#">coming soon!</a>
{% for post in site.categories.advanced %}
<a href="{{ post.url }}">{{ post.title }}</a>
{% endfor %}
@@ -50,6 +53,7 @@ <h3 id="blue">resources</h3>
<a href="http://gitcasts.com">GitCasts</a>
<a href="http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html">Git for everyone</a>
<a href="http://git.or.cz/course/svn.html">Git-SVN Crash Course</a>
+ <a href="http://cheat.errtheblog.com/s/git">Git Cheat Sheet</a>
</div>
</div>
</div>
View
3  _layouts/post.html
@@ -2,7 +2,8 @@
layout: default
---
<div id="post">
-{{ content }}
+ <h2>{{ page.title }}</h2>
+ {{ content }}
<div id="disqus">
<div id="disqus_thread"></div><script type="text/javascript" src="http://disqus.com/forums/git-ready/embed.js"></script><noscript><a href="http://git-ready.disqus.com/?url=ref">View the discussion thread.</a></noscript><a href="http://disqus.com" class="dsq-brlink">blog comments powered by <span class="logo-disqus">Disqus</span></a>
</div>
View
2  _posts/2009-01-09-checkout-remote-tracked-branch.textile
@@ -3,8 +3,6 @@ layout: post
title: checkout tracked remote branch
---
-h2. {{ page.title }}
-
I frequently need to do this when setting up or syncing my various machines, and I seem to forget the command all the time. So let's say you've got more than one branch on your remote, and you want to bring it down into your local repository as well:
p=. !http://gitready.com/images/branches.png!
View
6 _posts/2009-01-10-stashing-your-changes.textile
@@ -3,8 +3,6 @@ layout: post
title: stashing your changes
---
-h2. {{ page.title }}
-
Stashing is a great way to pause what you're currently working on and come back to it later. For example, if you working on that awesome, brand new feature but someone just found a bug that you need to fix. Add your changes to the index using
@git add .@
@@ -24,3 +22,7 @@ You can also do multiple layers of stashes, so make sure to use
To check out all of your current ones. If you need to apply a stash from deeper in the stack, that's easy too. Here's how to apply the second stash you've got:
<code>git stash apply stash@{1}</code>
+
+You can also easily apply the top stash on the stack by using ("Thanks jamesgolick!":http://jamesgolick.com/):
+
+@git stash pop@
View
22 _posts/2009-01-11-reverting-files.textile
@@ -0,0 +1,22 @@
+---
+layout: post
+title: reverting files
+---
+
+This is a topic that is a constant source of confusion for many git users, basically because there's more than one way to skin the proverbial cat. Let's go over some of the basic commands that you'll need to undo your work.
+
+So, you just want to revert one file back to its original state:
+
+@git checkout <file>@
+
+One problem with this is that you may have is that a file and branch named the same. Since the checkout command is used for both reverting files and swapping out to a different branch, you'll need to use this syntax (thanks, "Norbauer":http://norbauer.com/notebooks/code/notes/git-revert-reset-a-single-file)
+
+@git checkout -- <file>@
+
+If you want to throw out all of the changes you've been working on, there's two ways to do that.
+
+@git checkout -f@ or @git reset --HARD@
+
+Once these commands are run you'll lose all of the work that isn't committed in your directory, so make sure to take caution when using them.
+
+Also, be aware that "'git revert' is not equivalent to 'svn revert'!":http://bryan-murdock.blogspot.com/2007/07/git-revert-is-not-equivalent-to-svn.html @git-revert@ is used to reverse commits, something another tip will cover in the future.
View
12 css/screen.css
@@ -35,7 +35,7 @@ p {
ul.posts {
list-style-type: none;
- margin-bottom: 2em;
+ margin-bottom: 1.6em;
padding-left: 2em;
text-align: left;
}
@@ -99,13 +99,13 @@ ul.posts {
margin-left: 10px;
}
-.site .sidebar a, .site .sidebar a:hover {
+.site .sidebar div a, .site .sidebar div a:hover {
color: #000;
font-size: 82%;
}
h2{
- padding: 10px;
+ padding: 0 10px 10px;
font-size: 21px;
font-weight: normal;
text-align: left;
@@ -135,10 +135,12 @@ h3{
background: #AED180;
}
-#green { padding-top: 0; color: #99FF80; }
+#green { color: #99FF80; }
#red { color: #BF3030; }
#yellow { color: #B3B300; }
-#blue { color: #D8CFE6; }
+#blue { color: #809FFF; }
+#purple {padding: 0; }
+#purple a, #purple a:visited { color: #FF80FF; }
.site .title a.extra:hover {
color: black;
Please sign in to comment.
Something went wrong with that request. Please try again.