Skip to content

Commit 9428541

Browse files
author
Matthew McCullough
committed
Fleshed out refspecs
1 parent 2be000b commit 9428541

File tree

1 file changed

+39
-1
lines changed

1 file changed

+39
-1
lines changed

advanced/beta.md

Lines changed: 39 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -819,17 +819,49 @@ A sample `.gitconfig` file:
819819
{% endcapture %}
820820
{% include slide-section %}
821821

822-
#### Summary
822+
{% capture slide %}
823+
#### What are refspecs?
823824
* Specification for retrieval and pushing
824825
* Implied on fetch, pull, and push
825826
* Altered by option switches like `--tags`
826827
* Stored in `.git/config`
827828
* Ability to retrieve Pull Request branches
829+
{% endcapture %}
830+
{% include slide-section %}
831+
832+
{% capture slide %}
833+
#### Refspec examples
828834

829835
```
836+
# Source and destination refspecs
830837
$ git fetch [repo-url] [source]:[destination]
838+
839+
$ git fetch [repo-url] master
840+
* branch master -> FETCH_HEAD
841+
842+
$ git fetch origin refs/pull/1/head
843+
* branch refs/pull/1/head -> FETCH_HEAD
844+
```
845+
{% endcapture %}
846+
{% include slide-section %}
847+
848+
{% capture slide %}
849+
#### Refspec to retrieve pull requests
850+
851+
```
831852
$ git config --add remote.[upstream].fetch "+refs/pull/*/head:refs/remotes/[upstream]/pull/*"
832853
```
854+
{% endcapture %}
855+
{% include slide-section %}
856+
857+
858+
{% capture slide %}
859+
#### Git Refspec Documentation
860+
* [Git `rev-parse` command and reference specifications](https://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html)
861+
* [ProGit book chapter on refspecs](http://git-scm.com/book/en/Git-Internals-The-Refspec)
862+
{% endcapture %}
863+
{% include slide-section %}
864+
833865

834866

835867
{% capture slide %}
@@ -852,3 +884,9 @@ This course covers many advanced uses of Git and GitHub, and yet there is still
852884
* [oh-my-zsh, ZSH plugin framework](https://github.com/robbyrussell/oh-my-zsh)
853885
{% endcapture %}
854886
{% include slide-section %}
887+
888+
{% capture slide %}
889+
#### Git Documentation
890+
* [Git `man` page command documentation](https://www.kernel.org/pub/software/scm/git/docs/git.html)
891+
{% endcapture %}
892+
{% include slide-section %}

0 commit comments

Comments
 (0)