Skip to content

Commit e6319d0

Browse files
author
Matthew McCullough
committed
Merge pull request #59 from robertd/gh-pages
Add 'git branch -v' and 'git remote rename' explanations
2 parents d1c02d6 + 1c92bc8 commit e6319d0

File tree

2 files changed

+36
-1
lines changed

2 files changed

+36
-1
lines changed

branching/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -322,6 +322,21 @@ <h4>
322322
switch to it so your class renaming changes are isolated. We're going to
323323
change each instance of 'HelloWorld' to 'HiWorld'.</p>
324324

325+
<h4>
326+
git branch -v
327+
<small>see the last commit on each branch</small>
328+
</h4>
329+
330+
<p>If we want to see last commits on each branch
331+
we can run <code>git branch -v</code> to see them.</p>
332+
333+
<pre>
334+
<b>$ git branch -v</b>
335+
* <span class="green">master</span> 54b417d fix javascript issue
336+
development 74c111d modify component.json file
337+
testing 62a557a update test scripts
338+
</pre>
339+
325340
<pre>
326341
<b>$ git checkout -b change_class</b>
327342
Switched to a new branch 'change_class'

remotes/index.html

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,33 @@ <h4>
144144
<b>$ git remote -v</b>
145145
github [email protected]:schacon/hw.git (fetch)
146146
github [email protected]:schacon/hw.git (push)
147+
</pre>
148+
149+
<h4>
150+
git remote rename [old-alias] [new-alias]
151+
<small>rename remote aliases</small>
152+
</h4>
153+
154+
<p>If you want to rename remote aliases without having to delete them and add them again
155+
you can do that by running <code>git remote rename [old-alias] [new-alias]</code>. This will
156+
allow you to modify the current name of the remote.</p>
157+
158+
<pre>
159+
<b>$ git remote add github [email protected]:schacon/hw.git</b>
160+
<b>$ git remote -v</b>
161+
github [email protected]:schacon/hw.git (fetch)
162+
github [email protected]:schacon/hw.git (push)
163+
<b>$ git remote rename github origin</b>
164+
<b>$ git remote -v</b>
165+
origin [email protected]:schacon/hw.git (fetch)
166+
origin [email protected]:schacon/hw.git (push)
147167
</pre>
148168

149169
<p class="nutshell">
150170
<b>In a nutshell</b> with <code>git remote</code> you can list our
151171
remote repositories and whatever URL
152172
that repository is using. You can use <code>git remote add</code> to
153-
add new remotes and <code>git remote rm</code> to delete existing ones.
173+
add new remotes, <code>git remote rm</code> to delete existing ones or <code>git remote rename [old-alias] [new-alias]</code> to rename them.
154174
</p>
155175

156176
<h4>

0 commit comments

Comments
 (0)