(Re)generate: (find-git-intro)
Source code:  (find-efunction 'find-git-intro)
More intros:  (find-eev-quick-intro)
              (find-eev-intro)
              (find-eepitch-intro)
This buffer is _temporary_ and _editable_.
It is meant as both a tutorial and a sandbox.



At this moment this is a call for help -
not an intro.




0. Introduction

Git is extremely popular, and I've heard that the two packages that attract most new users to Emacs are Org and Magit: https://github.com/magit/magit https://melpa.org/#/magit (find-epackage 'magit) At this moment eev offers only a trivial hack to help people download git repositories. If you put the point on the github url above and type `M-h g' or `M-x find-git-links' you will get the same effect as running the sexp below: (find-git-links "https://github.com/magit/magit" "magit") You will get a temporary buffer with an e-script for downloading ("cloning") that git repository and inspecting it in a handful of ways. I found git VERY hard to learn. To test most concepts you need a repository with tags and branches and a second repository that "pulls" from it, and no books or tutorials that I know of come with a sequence of commands that set that up in a way that makes the tests easy to reproduce. To make things worse, when I was trying to set up a git repository for eev on github for the first time I did some things wrong on the github side of the repository that I did not know how to undo... after spending some days trying to fix that I gave up, deleted that repository, created a new one, and decided that I would always do LOTS of local tests before messing up my public repository again. This intro is about doing these local tests - but it is in a VERY early draft.

1. Preparation

Download the second URL below with `M-x brep', https://github.com/pluralsight/git-internals-pdf/ https://github.com/pluralsight/git-internals-pdf/releases/download/v2.0/peepcode-git.pdf and do the same for the fourth URL below here: https://git-scm.com/book/en/v2 https://github.com/progit/progit2 https://github.com/progit/progit2/releases https://github.com/progit/progit2/releases/download/2.1.277/progit.pdf Then run this eepitch block, * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -Rfv /tmp/git-test/ mkdir /tmp/git-test/ cd /tmp/git-test/ # http://anggtwu.net/bin/git-defs.html wget http://anggtwu.net/bin/git-defs cp -v $S/https/github.com/pluralsight/git-internals-pdf/releases/download/v2.0/peepcode-git.pdf . cp -v $S/https/github.com/progit/progit2/releases/download/2.1.277/progit.pdf . and this prog1: (prog1 (code-pdf-page "gitinternals" "/tmp/git-test/peepcode-git.pdf") (code-pdf-text "gitinternals" "/tmp/git-test/peepcode-git.pdf") (code-pdf-page "progit" "/tmp/git-test/progit.pdf") (code-pdf-text "progit" "/tmp/git-test/progit.pdf") (code-c-d "gitdoc" "/usr/share/doc/git-doc/") ) If can test if everything works by running the six sexps below: (find-fline "/tmp/git-test/git-defs") (find-gitinternalspage) (find-gitinternalstext) (find-progitpage) (find-progittext) (find-gitdocfile "")

2. A first repository

The manpage of git-revisions (find-man "7 git-revisions") (find-man "7 git-revisions" "Here is an illustration") (find-gitdocfile "revisions.txt" "illustration, by Jon Loeliger") has this example, in which the commits have this structure: G H I J \ / \ / D E F \ | / \ \ | / | \|/ | B C \ / \ / A Here is an e-script that creates it: * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -Rfv /tmp/git-test/repo1/ mkdir /tmp/git-test/repo1/ cd /tmp/git-test/repo1/ . /tmp/git-test/git-defs # (find-fline "/tmp/git-test/git-defs") git init Modify file1; Modify file2; git add file1 file2 Commit A; git branch brAC Modify file1; Commit B; git branch brBDG git checkout brAC Modify file1; Commit C git checkout brBDG Modify file1; Commit D git checkout HEAD^ -b brE Modify file1; Commit E git checkout HEAD^ git merge -s ours brAC -m F git branch brFI git checkout brBDG Modify file1; Commit G git checkout HEAD^ -b brH Modify file1; Commit H git checkout brFI Modify file1; Commit I git checkout HEAD^ -b brJ Modify file1; Commit J Diagram # (find-gitk "/tmp/git-test/repo1/") Actually it creates the structure below - where, for example, the node "G,brBDG" is a commit with message "G" and a branch called "brBDG" pointing to it; I call that branch "brBDG" because when it was created it pointed to the commit with message "B", then it moved to the commit "D", then to "G". I,brFI J,brJ | / G,brBDG H,brH | / \ / | / D E,brE F \ | / \ \ | / | \ | / | B C,brAC \ / \ / A Here's a video showing the script above in action: http://anggtwu.net/eev-videos/2020-doubt-about-merging.mp4 (code-eevvideo "merg" "2020-doubt-about-merging") (find-mergvideo "0:00") (find-mergvideo "0:20") NEXT STEPS: explain how to use git merge both from the command line and from magit; explain HEAD, master, and tags. Point to man pages in man and text format and to sections in Scott Chacon's book. I NEED LOTS OF HELP HERE. (find-man "git-merge") (find-gitinternalspage) (find-gitinternalstext)

3. A second repository

HELP PLEEEASEEEE * (eepitch-shell) * (eepitch-kill) * (eepitch-shell) rm -Rfv /tmp/git-test/repo2/ mkdir /tmp/git-test/repo2/ cd /tmp/git-test/repo2/ . /tmp/git-test/git-defs # (find-fline "/tmp/git-test/git-defs") git clone /tmp/git-test/repo1/ . ls -lAF # (find-gitk "/tmp/git-test/repo2/") # (find-fline "/tmp/git-test/repo2/") # (find-fline "/tmp/git-test/repo2/.git/") # (find-fline "/tmp/git-test/repo2/.git/config") # (find-man "1 git-remote") # (find-progitpage (+ 24 36) "Adding Remote Repositories") # (find-progittext (+ 24 36) "Adding Remote Repositories")