@@ -819,17 +819,49 @@ A sample `.gitconfig` file:
819
819
{% endcapture %}
820
820
{% include slide-section %}
821
821
822
- #### Summary
822
+ {% capture slide %}
823
+ #### What are refspecs?
823
824
* Specification for retrieval and pushing
824
825
* Implied on fetch, pull, and push
825
826
* Altered by option switches like ` --tags `
826
827
* Stored in ` .git/config `
827
828
* Ability to retrieve Pull Request branches
829
+ {% endcapture %}
830
+ {% include slide-section %}
831
+
832
+ {% capture slide %}
833
+ #### Refspec examples
828
834
829
835
```
836
+ # Source and destination refspecs
830
837
$ 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
+ ```
831
852
$ git config --add remote.[upstream].fetch "+refs/pull/*/head:refs/remotes/[upstream]/pull/*"
832
853
```
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
+
833
865
834
866
835
867
{% capture slide %}
@@ -852,3 +884,9 @@ This course covers many advanced uses of Git and GitHub, and yet there is still
852
884
* [ oh-my-zsh, ZSH plugin framework] ( https://github.com/robbyrussell/oh-my-zsh )
853
885
{% endcapture %}
854
886
{% 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