Warning: this is an htmlized version!
The original is across this link,
and the conversion rules are here.
#######
#
# E-scripts on git.
#
# Note 1: use the eev command (defined in eev.el) and the
# ee alias (in my .zshrc) to execute parts of this file.
# Executing this file as a whole makes no sense.
#
# Note 2: be VERY careful and make sure you understand what
# you're doing.
#
# Note 3: If you use a shell other than zsh things like |&
# and the for loops may not work.
#
# Note 4: I always run as root.
#
# Note 5: some parts are too old and don't work anymore. Some
# never worked.
#
# Note 6: the definitions for the find-xxxfile commands are on my
# .emacs.
#
# Note 7: if you see a strange command check my .zshrc -- it may
# be defined there as a function or an alias.
#
# Note 8: the sections without dates are always older than the
# sections with dates.
#
# This file is at <http://angg.twu.net/e/git.e>
#           or at <http://angg.twu.net/e/git.e.html>.
#        See also <http://angg.twu.net/emacs.html>,
#                 <http://angg.twu.net/.emacs[.html]>,
#                 <http://angg.twu.net/.zshrc[.html]>,
#                 <http://angg.twu.net/escripts.html>,
#             and <http://angg.twu.net/>.
#
#######





# «.git-doc»			(to "git-doc")
# «.specifying»			(to "specifying")
# «.git-shallow-clone»		(to "git-shallow-clone")
# «.git-plumbing»		(to "git-plumbing")
# «.git-config»			(to "git-config")
# «.gitk»			(to "gitk")
# «.gitk-tkdiff»		(to "gitk-tkdiff")
# «.git-diff»			(to "git-diff")
# «.pro-git»			(to "pro-git")
# «.git»			(to "git")
# «.git.el»			(to "git.el")
# «.github-repo-create»		(to "github-repo-create")
# «.github-repo-setup»		(to "github-repo-setup")
# «.git-test»			(to "git-test")
# «.git-test-branch-merge»	(to "git-test-branch-merge")
# «.git-squash-commits»		(to "git-squash-commits")
# «.git-animations-intro»	(to "git-animations-intro")
# «.git-animations»		(to "git-animations")
# «.git-test-squash-commits»	(to "git-test-squash-commits")
# «.git-test-2»			(to "git-test-2")
# «.jonas»			(to "jonas")
# «.git-clean»			(to "git-clean")
# «.deltas»			(to "deltas")
# «.emacs-from-git»		(to "emacs-from-git")
# «.gitmagic»			(to "gitmagic")
# «.magit»			(to "magit")
# «.magit-deb-src»		(to "magit-deb-src")
# «.magit-from-git»		(to "magit-from-git")
# «.very-hard-reset»		(to "very-hard-reset")
# «.merge-different»		(to "merge-different")
# «.default-branch»		(to "default-branch")
# «.git-server»			(to "git-server")
# «.git-instaweb»		(to "git-instaweb")
# «.not-compressing»		(to "not-compressing")
# «.git-config-local»		(to "git-config-local")
# «.git-annex»			(to "git-annex")
# «.diags»			(to "diags")
# «.eev-branches»		(to "eev-branches")
# «.mtimes»			(to "mtimes")
# «.git-deb-src»		(to "git-deb-src")
# «.bare-repos»			(to "bare-repos")
# «.eev2-and-0.95.3-prototype»	(to "eev2-and-0.95.3-prototype")
# «.obsoletes-in-angg»		(to "obsoletes-in-angg")
# «.detached-head»		(to "detached-head")
# «.gitorious»			(to "gitorious")
# «.org-contribute»		(to "org-contribute")
# «.eev-git-repo-simple»	(to "eev-git-repo-simple")
# «.create-bare-and-push»	(to "create-bare-and-push")
# «.last-commit-message»	(to "last-commit-message")
# «.irc-channel»		(to "irc-channel")
# «.github-guides»		(to "github-guides")
# «.eev-verena»			(to "eev-verena")




# (find-zsh "installeddebs | sort | grep git")
# (find-zsh "availabledebs | sort | grep git")




#####
#
# Docs in the git-doc Debian package
# 2013feb10
#
#####

# «git-doc» (to ".git-doc")
# (find-status   "git-doc")
# (find-vldifile "git-doc.list")
# (find-udfile   "git-doc/")
# (find-udfile   "git-doc/technical/")
# (find-status   "git")
# (find-vldifile "git.list")
# (find-udfile   "git/")
# (find-status   "git-man")
# (find-vldifile "git-man.list")
# (find-udfile   "git-man/")

# file:///usr/share/doc/git-doc/user-manual.html
#         (find-udfile "git-doc/user-manual.txt")
#         (find-udfile "git-doc/")
# file:///usr/share/doc/git-doc/everyday.html
#         (find-udfile "git-doc/everyday.txt")
# file:///usr/share/doc/git-doc/index.html
# file:///usr/share/doc/git-doc/index.html

cd /tmp/
git
git help
# (find-sh "git help ls-files")
# (find-man "git-ls-files")
# (find-sh "locate ls-files")




#####
#
# Ways to specify objects
# 2013feb15
#
#####

# «specifying» (to ".specifying")
# (find-gitdocgrep "grep -nirH -e specify *")
# (find-gitdocw3m "gitrevisions.html")
# (find-gitdocw3m "gitrevisions.html" "SPECIFYING REVISIONS")
# (find-man "7 gitrevisions")
# (find-man "7 gitrevisions" "$GIT_DIR/logs/<refname>")
# (find-man "7 gitrevisions" "^<n>")
# (find-man "7 gitrevisions" "<rev>~<n>")
# (find-man "7 gitrevisions" "illustration" "Loeliger")
# (find-eevfile ".git/")
# (find-eevfile ".git/logs/")
# (find-eevfile ".git/logs/refs/heads/master")
# (find-eevfile ".git/logs/refs/remotes/origin/master")

# (find-man "git-rev-parse")




#####
#
# Git: shallow clone
# 2012oct27
#
#####

# «git-shallow-clone» (to ".git-shallow-clone")
# http://stackoverflow.com/questions/6941889/is-git-clone-depth-1-shallow-clone-more-useful-than-it-makes-out
# (find-man "1 git-clone")
# (find-man "1 git-clone" "  --depth <depth>")
# (find-man "1 git-pull")
# (find-man "1 git-pull" "--depth=<depth>")




#####
#
# Git: plumbing
# 2011jan04
#
#####

# «git-plumbing»  (to ".git-plumbing")
# http://git-plumbing-preso.heroku.com/
# (find-man "1 git-write-tree")
# (find-man "1 git-update-index")
# (find-man "1 git-cat-file")
# (find-man "1 git-hash-object")
# (find-man "1 git-write-tree")
# (find-man "1 git-read-tree")
# (find-man "1 git-ls-files")
# (find-man "1 git-checkout-index")
# (find-man "1 git-log")

# (find-man "1 git-tag")



#####
#
# git-config
# 2011jan05 / 2013feb13
#
#####

# «git-config»  (to ".git-config")
# «git-config-local» (to ".git-config-local")
# http://www.kernel.org/pub/software/scm/git/docs/git-config.html
# (find-man "1 git-config")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg ".gitconfig")
# (find-man "1 git-config")
git config --global user.name "Eduardo Ochs"
git config --global user.email eduardoochs@gmail.com
cat ~/.gitconfig

# If the identity used for this commit is wrong, you can fix it with:
# git commit --amend --author='Your Name <you@example.com>'
# (find-man "1 git-commit" "--amend\n")
# (find-man "1 git-commit" "--author=<author>\n")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)

# (find-fline "/tmp/foo/")
rm -Rfv /tmp/foo/
mkdir   /tmp/foo/
cd      /tmp/foo/
git init
git config user.name "Foo Bar"
# (find-fline "/tmp/foo/.git/config")
# (find-angg            ".gitconfig")
echo A > a
git add a
git commit -a -m 'Initial'
gitk &

# Bad news: git-config doesn't check for valid tags...
git config blitch.bletch "Plic Ploc"
# (find-fline "/tmp/foo/.git/config")
# But it can be used to extract 
git config blitch.bletch






#####
#
# gitk
# 2011jan04
#
#####

# «gitk»  (to ".gitk")
# (find-status   "git-gui")
# (find-vldifile "git-gui.list")
# (find-udfile   "git-gui/")
# (find-status   "gitk")
# (find-vldifile "gitk.list")
# (find-udfile   "gitk/")

# (find-man "1 git-citool")
# (find-man "1 git-gui")
# (find-fline "/usr/lib/git-core/git-gui")
# (find-fline "/usr/lib/git-core/git-citool")

# (find-man "1 gitk")
# (find-fline "/usr/bin/gitk")

# (find-man "1 git-log" "HEAD")
# http://lists.zerezo.com/git/msg648261.html

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv ~/usrc/luarocks-2.0.4/
tar -C ~/usrc/ -xvzf \
  $S/http/luarocks.org/releases/luarocks-2.0.4.tar.gz
cd     ~/usrc/luarocks-2.0.4/
git init
git ls-files
git add .
git ls-files
git commit -m "Initial commit"
git ls-files
git log | cat
gitk


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-sh "cd ~/usrc/ && find * -type d | sort")
# (find-sh "cd ~/usrc/ && find * -type d | grep git | sort")
# (find-fline "~/usrc/lua-mode/.git")
cd ~/usrc/lua-mode/
gitk .




#####
#
# gitk with tkdiff
# 2013jan16
#
#####

# «gitk-tkdiff» (to ".gitk-tkdiff")
# (find-es "tcl" "tkdiff-deb-src")
# http://stackoverflow.com/questions/255202/how-do-i-view-git-diff-output-with-a-visual-diff-program
# (find-esgrep "grep -niH -e tkdiff *.e")

# (find-man "1 git-diff")
# (find-man "1 git-difftool")
# (find-man "1 git-difftool" "tkdiff")
# (find-man "1 git-config")
# (find-angg ".gitk")




#####
#
# git-diff
# 2013jan27
#
#####

# «git-diff» (to ".git-diff")
# (find-man "1 git-diff")
# How can I extract two versions of a repo into a/ and b/,
# and then run a build in each, and compare the resulting binaries?

# (find-man "1 git-checkout")
# (find-node "(magit)Diffing")




#####
#
# Scott Chacon's "Pro Git" book
# 2013feb10
#
#####

# «pro-git» (to ".pro-git")
# http://book.git-scm.com/
# http://git-scm.com/book
# https://github.s3.amazonaws.com/media/progit.en.pdf

;; (find-fline "$S/https/github.s3.amazonaws.com/media/")
(code-xpdf     "progit" "$S/https/github.s3.amazonaws.com/media/progit.en.pdf")
(code-pdf-text "progit" "$S/https/github.s3.amazonaws.com/media/progit.en.pdf" 7)
;; (find-progitpage)
;; (find-progittext)
;; (find-progitpage (+ 7 43) "Git Branching")
;; (find-progittext (+ 7 43) "Git Branching")

# http://git-scm.com/book/en/Git-on-the-Server-The-Protocols
# http://git-scm.com/book/en/Git-Branching-What-a-Branch-Is




#####
#
# git
# 2010aug14
#
#####

# «git»  (to ".git")
# (find-books "__comp/__comp.el" "git")
# http://eagain.net/articles/git-for-computer-scientists/
# http://book.git-scm.com/
# https://git.wiki.kernel.org/index.php/GitDocumentation
# http://www.emacswiki.org/cgi-bin/wiki/Git

# (find-es "lua5" "luainspect")
# http://excess.org/article/2008/07/ogre-git-tutorial/
# http://git-scm.com/course/svn.html
# http://utsl.gen.nz/talks/git-svn/intro.html#getting
# http://www.kernel.org/pub/software/scm/git/docs/everyday.html
# http://www.kernel.org/pub/software/scm/git/docs/gittutorial.html
# http://www.spheredev.org/wiki/Git_for_the_lazy
# http://sysmonblog.co.uk/misc/git_by_example/

# (find-status   "git-core")
# (find-vldifile "git-core.list")
# (find-udfile   "git-core/")
# (find-status   "git-doc")
# (find-vldifile "git-doc.list")
# (find-udfile   "git-doc/")
# (find-udfile   "git-doc/git-checkout.txt" "git checkout master")


* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv ~/usrc/luarocks-2.0.4/
tar -C ~/usrc/ -xvzf \
  $S/http/luarocks.org/releases/luarocks-2.0.4.tar.gz
cd     ~/usrc/luarocks-2.0.4/

git init && git add . && git commit -m "Initial commit"

cd     ~/usrc/luarocks-2.0.4/
./configure
./configure --help
./configure \
  --with-lua=$LUA51SRC \
  --prefix=$HOME/usrc/luarocks
make         |& tee om
make install |& tee omi

git commit -a -m "After make and make install"

patch -p0 src/luarocks/build.lua <<'%%%'
100a101
>    print("[At: build_rockspec]")
%%%

git commit -a -m "Trivial test patch"
gitk
git diff --patch master@{1} | cat
# git diff --patch "After make and make install" | cat




#####
#
# git.el
# 2011feb04
#
#####

# «git.el»  (to ".git.el")
# (find-sh "locate git.el")
# (find-efile "vc-git.el")
# (find-udfile "git/contrib/emacs/")
# (find-udfile "git/contrib/emacs/git.el")
# (find-udfile "git/contrib/emacs/git.el" "Wrappers for basic git commands")
# (find-udfile "git/contrib/emacs/README")
# (find-node "(pcl-cvs)Top")
# (find-fline "~/usrc/ditaa/")

(add-to-list 'load-path "/usr/share/doc/git/contrib/emacs/")
(require 'git)





#####
#
# Githug reposity: creating
# 2011nov27
#
#####

# «github-repo-create»  (to ".github-repo-create")
# «github-repo-setup»  (to ".github-repo-setup")
# http://peekaboo.github.com/

Instructions for setting up username.github.com *
  Create a repo named username.github.com
  Push a `master` branch to GitHub and enjoy!
Instructions for setting up username.github.com/repo-name *
  cd /path/to/repo-name
  git symbolic-ref HEAD refs/heads/gh-pages
  rm .git/index
  git clean -fdx
  echo "My GitHub Page" > index.html
  git add .
  git commit -a -m "First pages commit"
  git push origin gh-pages
Caution: make your working directory clean before you do this (either
stash or commit), otherwise this will lose any changes you've made to
your project since the last commit.

# (find-man "git-symbolic-ref")




#####
#
# Git test (for a tutorial?)
# 2012nov24
#
#####

# «git-test» (to ".git-test")
# (find-es "cvs" "bzr-test")
# (code-c-d "gittest" "/tmp/git-test/")
# (find-gittestfile "")
# (defun eejump-9 () (find-gittestsh0 "gitk"))

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
N=0
  N () { echo $N; }
++N () { N=$[$N+1]; echo $N; }
Dump1   () { echo $1 \($(cat $1)\); }
Dumps   () { for i in $*; do Dump1 $i; done; }
Dump    () { Dumps $(find * -type f | sort); }
Modify1 () { ++N >> $1; Dump1 $1; }
Modify  () { for i in $*; do Modify1 $i; done; }

rm -Rfv /tmp/git-test/
mkdir   /tmp/git-test/
cd      /tmp/git-test/
# (find-fline "/tmp/git-test/")
mkdir d
N=0
Modify a b d/c d/d
Modify a
Dump

git init
git add -n -v .
git add .
# (find-gittestsh0 "gitk")

git ls-files
git commit -m Initial
# (find-gittestsh0 "gitk")

Modify a
git commit --dry-run
git commit --dry-run -m 'Rev 6'

git ls-files
git add -n -v .
git commit --dry-run -m 'Rev 6'
git commit           -m 'Rev 6'
# (find-gittestsh0 "gitk")
git commit        -a -m 'Rev 6'
# (find-gittestsh0 "gitk")
git commit        -a -m 'Rev 7'
# (find-gittestsh0 "gitk")
Modify b
git commit        -a -m 'Rev 7'
# (find-gittestsh0 "gitk")

# (find-fline "/tmp/git-test/")

# (find-man "1 git-add")
# (find-man "1 git-add" "-n, --dry-run")

# (find-man "tee")




#####
#
# git test: branch and merge
# 2013sep03
#
#####

# «git-test-branch-merge» (to ".git-test-branch-merge")
# (find-angg ".emacs" "pro-git")
# (find-progitpage (+ 7 48) "3.2 Basic Branching and Merging")
# (find-progittext (+ 7 48) "3.2 Basic Branching and Merging")
# (find-progitpage (+ 7 63) "3.6 Rebasing")
# (find-progittext (+ 7 63) "3.6 Rebasing")
# (find-progitpage (+ 7 147) "6.4.4 Squashing a Commit")
# (find-progittext (+ 7 147) "6.4.4 Squashing a Commit")
# (find-man "1 git-checkout")
# (find-man "1 git-rebase")
# (find-man "1 git-merge")
# (find-man "1 git-merge" "--squash")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg "bin/git-defs")
. ~/bin/git-defs

rm -Rf   /tmp/git/here/
mkdir -p /tmp/git/here/
cd       /tmp/git/here/
git init

Modify a b
git add a b
Commit
Modify a b
Commit
Diagram

git branch base

git branch idea
* (D)
git checkout idea;   Modify a; Commit
git checkout master; Modify b; Commit
git checkout idea;   Modify a; Commit
* (D)
Diagram
Dump
git checkout master; Modify b; Commit
Diagram
Dump

git merge --no-edit idea
Diagram
Dump

# (find-gitk "/tmp/git/here/")




#####
#
# Squashing commits
# 2013sep04
#
#####

# «git-squash-commits» (to ".git-squash-commits")
# <edrx> ok, so I just learned how to use "git rebase -i <branch>"...
#        but how can I do something equivalent to that
#        non-interactively when I am absolutely sure that all the
#        commits since "<branch>" are to be squashed, and when I want
#        the message for that new commit - the one that synthesizes
#        all the ones I'm squashing - to be "foo bar"?
# <moritz> edrx: there's a git merge --squash; not sure if it does
#          what you want though
# <edrx> moritz: thanks - I just found a chapter about squashing in
#        the Pro Git book, btw... reading
# <jast> edrx: if you want to squash absolutely all commits since
#        then, you can do this (assuming there are no uncommitted
#        changes): git reset --soft <branch>; git commit
# <edrx> jast: trying
# <edrx> jast: brilliant, thanks =)

# (find-man "git-reset" "  --soft")
# (find-man "git-checkout" "If -b is given")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg "bin/git-defs")
. ~/bin/git-defs

rm -Rf   /tmp/git/here/
mkdir -p /tmp/git/here/
cd       /tmp/git/here/
git init

Modify a b; git add a b; Commit
Modify a b; Commit
git branch base
git branch idea
git checkout idea;   Modify a; Commit
git checkout master; Modify b; Commit
git checkout idea;   Modify a; Commit
git checkout master; Modify b; Commit
git merge --no-edit idea
git branch slow
Diagram
Dump

git reset --soft base
git checkout -b new
git commit -a -m '5 6 7 8'
Diagram
Dump

Dump; echo; Diagram


# (find-gitk "/tmp/git/here/")





#####
#
# Git animations - a video
# 2013nov24
#
#####

# «git-animations-intro» (to ".git-animations-intro")


Git animations
==============
We will use eev - in particular eepitch and find-wset - to show what
happens when we do branches and merges in Git. Our window setting will
be this:

   _______________________________________________________
  |                |                                      |
  |                |                 shell                |
  |                |                                      |
  |    e-script    |______________________________________|
  |                |                    |                 |
  |                |  diagram "before"  |  diagram "now"  |
  |                |   (at time t-1)    |   (at time t)   |
  |________________|____________________|_________________|

The commands in a pre-prepared e-script will be sent to a shell by
eepitch (when we type <f8>) and executed. When we type <f8> at a line
that starts with a red star the line is executed as Lisp instead of
being sent to a shell, and the lines like

  * (D)

update the two diagrams: the last diagram is moved to a buffer called
"*old dump/diagram*", and a diagram showing the current state of both
the "working directory" and the "git directory" is produced and put at
the buffer "*dump/diagram*".

The directories that we will use are:

  /tmp/git/here/      - the "working directory"
  /tmp/git/here/.git/ - the "git directory"

and the "Modify" command the we will use to change files in the
working directory just updates a counter and adds numbers to the end
of the files whose names are given as its arguments. The numbers
appear in separate lines in the files, but the "Dump" command shows
each file in the working directory in a single line. The "* (D)" lines
run the shell functions "Dump" and "Diagram", where "Diagram" runs
this:

  git log --oneline --graph --decorate --all --date-order






shell


diagram "before"    diagram "now"
 (at time t-1)       (at time t)








which are
described here,

  http://










#####
#
# git animations (for a possible video)
# 2013sep07
#
#####

# «git-animations» (to ".git-animations")
# (find-angg ".emacs" "find-gitdiag")
* (defun d () (interactive) (find-gitddiag    "/tmp/git/here/"))
* (defun D () (interactive) (find-gitddiag-4a "/tmp/git/here/"))

* (eek "C-x 1") (ee-kill-buffer "*dump/diagram*")
* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg "bin/git-defs")
. ~/bin/git-defs

rm -Rf   /tmp/git/here/
mkdir -p /tmp/git/here/
cd       /tmp/git/here/
git init
Modify a b; git add a b; Commit
* (D)
Modify a b; Commit
* (D)
git branch base
* (D)
git branch idea
* (D)
git checkout idea
* (D)
Modify a; Commit
* (D)
# (find-gitk "/tmp/git/here/")

git checkout master
* (D)
Modify b; Commit
* (D)
git checkout idea
* (D)
Modify a; Commit
* (D)
git checkout master
* (D)
Modify b; Commit
* (D)
# (find-gitk "/tmp/git/here/")

git checkout idea
* (D)
git checkout master
* (D)

git merge --no-edit idea
Diagram
Dump
* (D)
# (find-gitk "/tmp/git/here/")

git branch slow
* (D)
git reset --soft base
* (D)
git checkout -b fast
* (D)
git commit -a -m '5 6 7 8'
* (D)


** Delete the slow branch
git branch -D idea
* (D)
git branch -D slow
* (D)
git branch -D base
* (D)

git branch

# (find-man "git-branch")
Diagram
Dump

Dump; echo; Diagram


# (find-gitk "/tmp/git/here/")








# «git-test-squash-commits» (to ".git-test-squash-commits")

git branch -d idea
git checkout base
git branch new
git checkout new
git merge --squash master
Dump
Diagram
git commit -a -m '5 6 7 8'
Diagram

git checkout master
git reset --soft base
git branch   new2
git checkout new2
git commit -a -m '5 6 7 8'
Dump
Diagram



git branch new
git merge --squash

# http://sethrobertson.github.io/GitBestPractices/#sausage
# http://sethrobertson.github.io/GitPostProduction/gpp.html

git rebase base
Diagram
export EDITOR=$HOME/bigsrc/emacs/lib-src/emacsclient
git rebase -i base
Diagram
Dump



# (find-man "1 git-merge")
# (find-man "1 git-merge" "\nMERGE STRATEGIES")
# (find-man "1 git-rebase")
# (find-man "1 git-rebase" "-i, --interactive")

# (find-gitk "/tmp/git/here/")

rm -fr /tmp/git/here/.git/rebase-merge





#####
#
# git test (2)
#
#####

# «git-test-2» (to ".git-test-2")
# (find-angg ".zshrc" "git-test")
# (find-man "1 git-reset")
# (find-man "1 git-branch")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-angg "bin/git-defs")
. ~/bin/git-defs

rm -Rf   /tmp/git/remote/
mkdir -p /tmp/git/remote/
cd       /tmp/git/remote/
git init --bare

rm -Rf   /tmp/git/here/
mkdir -p /tmp/git/here/
cd       /tmp/git/here/
git clone /tmp/git/remote/ .

Modify a b
git add a b
Commit
git push origin master
Modify a b
Commit
Diagram

git push origin master

git branch idea
Modify a b; Commit
Modify a b; Commit
git checkout master
Diagram

# (find-gitk "/tmp/git/here/")
# (find-gitk "/tmp/git/remote/")
git push
N


rm -Rf /tmp/here/
mkdir  /tmp/here/
cd     /tmp/here/
git clone /tmp/public/ .
echo 1 > VERSION
echo 2 > otherfile
git add VERSION otherfile
git commit -a -m 'Created a git repository'
git push origin master

git branch idea
git checkout idea
Diagram
Modify a b; Commit
Diagram

git checkout master
Diagram
Modify a b; Commit
Diagram

git checkout idea
Diagram


# This:
#   git clone /tmp/git/remote/ .
# is equivalent to:
#   git init
#   git remote add origin /tmp/git/remote/
# Check with:
#   git remote -v







#####
#
# Jonas's hints
# 2012oct31
#
#####

# «jonas» (to ".jonas")
# (find-man "1 git-clone")
# (find-man "1 git-clone" "  --bare")
# (find-man "1 git-init")
# (find-man "1 git-remote")
# (find-man "1 git-commit")
# (find-man "1 git-tag")
# (find-man "1 git-push")
# (find-man "1 git-branch")
# (find-man "1 git-checkout")
# (find-man "1 git-add")
# (find-man "1 git-rm")
# (find-man "1 git-ls-files")
# (find-man "1 git-merge")

You should branch earlier as (I think) you plan to do:

tar -xf eev-current.tar
# possibly rename directory, and make sure there is no unnecessary nesting
cd eev
git init
git remote add origin git@github.com:you/eev.git
git add .
git commit -m "initial import of version xy"
git tag 0.95.1
git push origin master --tags

git branch next
git checkout next
rm * # but make sure you don't remove .git
tar -xf eev-work-in-progress.tar
# again possibly rename directory...
git add .
git rm $(git ls-files --deleted-files)
git commit -m "import work in progress"

... hack commit hack commit ...

git checkout master
git merge next
git tag 0.95.2
git push origin master --tags

* and then to fix bugs in the stable branch

git checkout master

* resp. to work on new features

git checkout next   # or better
git checkout feature/SOMEFEATURE

Hope that helps a bit,
Jonas




#####
#
# git-clean
# 2012nov18
#
#####

# «git-clean» (to ".git-clean")
# (find-man "1 git-clean")
# (find-man "1 git-clone")
# (find-man "1 git-fetch")
# (find-man "1 git-merge")
# (find-man "1 git-pull")
# (find-man "1 git-reset")
# (find-man "1 git-reset" "worktree")

# http://sethrobertson.github.com/
# http://sethrobertson.github.com/GitFixUm/
# http://sethrobertson.github.com/GitFixUm/fixup.html
# (find-fline "~/LOGS/2012nov18.git")

# http://wiki.nosdigitais.teia.org.br/IRC_DEV

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/lalenia0/
mkdir   /tmp/lalenia0/
rm -Rfv /tmp/lalenia/
mkdir   /tmp/lalenia/
ln -s ../lalenia0/.git /tmp/lalenia/.git
cd      /tmp/lalenia/
laf
cd     /tmp/
git clone git://labmacambira.git.sourceforge.net/gitroot/labmacambira/lalenia
# fatal: destination path 'lalenia' already exists and is not an empty directory.

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/lalenia*





cd ~/usrc/
mkdir gits/

mkdir lalenia0/
mv -iv lalenia/.git lalenia0/

mkdir  lalenia/
mv -v /tmp/lalenia/.git lalenia/
mkdir lalenia0/
mv -ivt lalenia/.git lalenia0/

# (find-man "mv")



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rv /tmp/lalenia/
mkdir  /tmp/lalenia/
cd     /tmp/
git clone --depth 1 \
  git://labmacambira.git.sourceforge.net/gitroot/labmacambira/lalenia
cd     /tmp/lalenia/
laf
date > MESS
laf
git clean -dfx
echo FOOOOOOOOO >> README.txt
git reset --hard
git pull
rm -Rv /tmp/lalenia/conf/
rm -Rv /tmp/lalenia/plugins/
git checkout

# (find-fline "/tmp/lalenia/")
# (find-man "1 git-clean")

<SethRobertson> cd directory; git clean -dfx; git reset --hard; git
                pull
<SethRobertson> Note this will destroy all uncommitted changes.  If
                you want to destroy committed changes I can provide
                an updated script





#####
#
# Deltas
# 2012dec01
#
#####

# «deltas» (to ".deltas")
# (find-angg ".emacs" "git")
# (find-gitinternalstext  93 "delta-compressed")
# (find-man "1 git-gc")

/home/edrx/bigsrc/git(edrx:va)# git clone --depth=1 git://git.sv.gnu.org/emacs
Cloning into emacs...
remote: Counting objects: 90110, done.        
remote: Compressing objects: 100% (39511/39511), done.        
remote: Total 90110 (delta 81670), reused 55997 (delta 50071)        
Receiving objects: 100% (90110/90110), 176.65 MiB | 93 KiB/s, done.
Resolving deltas: 100% (81670/81670), done.
/home/edrx/bigsrc/git(edrx:va)# 




#####
#
# Emacs from git
# 2012nov07
#
#####

# «emacs-from-git» (to ".emacs-from-git")
# (find-es "cvs" "emacs-from-bzr")
# (find-es "emacs" "emacs-from-git")
# http://emacswiki.org/emacs/EmacsFromGit
# http://www.cyber.com.au/~twb/.bin/twb-get

# (find-man "1 git-clone")
# (find-man "1 git-clone" "  --bare")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/bigsrc/")
# (find-fline "~/bigsrc/git/")
# (find-fline "~/bigsrc/git/emacs/")
# (find-fline "~/bigsrc/emacs/")
rm -Rfv  ~/bigsrc/emacs/
mkdir -p ~/bigsrc/emacs/
cd       ~/bigsrc/
git clone --depth=1 git://git.sv.gnu.org/emacs
cd       ~/bigsrc/emacs/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Reset the working directory from the .git/ directory.
# This is MUCH stronger than a "make clean".
# (find-man "1 git-reset")
# (find-man "1 git-pull")
#
cd   ~/bigsrc/emacs/
find ~/bigsrc/emacs/ -maxdepth 1 -mindepth 1 | sort
find ~/bigsrc/emacs/ -maxdepth 1 -mindepth 1 | sort | grep -v '/\.git$'
rm -Rv $(
find ~/bigsrc/emacs/ -maxdepth 1 -mindepth 1 | sort | grep -v '/\.git$'
)
git pull

git clean -dfx
git reset --hard

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
cd ~/bigsrc/emacs/
./autogen.sh     |& tee oag
# (or you can just run `autoreconf -i -I m4').
./configure      |& tee oc
make bootstrap   |& tee omb

* (eepitch-shell2)
* (eepitch-kill)
* (eepitch-shell2)
# (find-man "1 git-pull")
cd ~/bigsrc/emacs/
git pull --depth=1 |& tee ogp
make               |& tee om

gitk &



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
apt-get build-dep emacs
R
apt-get install libxpm-dev libjpeg-dev libxml2-dev

# 2013aug30:
# (setq ee-git-dir "~/bigsrc/")
# (find-git-links "git://git.sv.gnu.org/emacs" "emacs")
# rm -Rfv ~/bigsrc/emacs/
cd      ~/bigsrc/
git clone --depth 1 git://git.sv.gnu.org/emacs
cd      ~/bigsrc/emacs/

cd ~/bigsrc/emacs/
./autogen.sh     |& tee oag
# (or you can just run `autoreconf -i -I m4').
./configure      |& tee oc
make bootstrap   |& tee omb

# (find-sh0 "rm -v ~/bin/emacs24")
# (find-sh0 "cd ~/bin/ && cp -s ../bigsrc/emacs/src/emacs emacs24")

# (code-c-d "gitemacs" "~/bigsrc/git/emacs/")
# (code-c-d "gitemacs" "~/bigsrc/emacs/")
# (find-gitemacsfile "")
# (find-gitemacssh "find | sort")
# (find-gitemacssh "du -c")

# (find-gitemacsfile "INSTALL.BZR")
# (find-gitemacsfile "INSTALL.BZR" "configure.ac")
# (find-gitemacsfile "configure.ac" "AC_PREREQ")
# (find-gitemacsfile "configure.ac" "AM_INIT_AUTOMAKE")
# (find-status "autoconf")
# (find-status "automake")






#####
#
# Git magic
# 2013jan06
#
#####

# «gitmagic» (to ".gitmagic")
# http://www-cs-students.stanford.edu/~blynn/gitmagic/
# (find-status   "gitmagic")
# (find-vldifile "gitmagic.list")
# (find-udfile   "gitmagic/")

;; (find-fline "/usr/share/doc/gitmagic/")
(code-xpdf     "gitmagic" "/usr/share/doc/gitmagic/gitmagic.pdf")
(code-pdf-text "gitmagic" "/usr/share/doc/gitmagic/gitmagic.pdf")
;; (find-gitmagicpage)
;; (find-gitmagictext)

# file:///usr/share/doc/gitmagic/gitmagic.html
# file:///usr/share/doc/gitmagic/html/index.html
# (find-fline "/usr/share/doc/gitmagic/html/")



#####
#
# Magit
# 2013jan27
#
#####

# «magit» (to ".magit")
# http://www.emacswiki.org/emacs/Magit
# http://emacswiki.org/emacs/Git
# http://www.emacswiki.org/emacs/Magit
# http://philjackson.github.com/magit/magit.html
# http://philjackson.github.com/magit/
# http://github.com/magit/magit/downloads
# http://alexott.net/en/writings/emacs-vcs/EmacsGit.html

;; https://vimeo.com/2871241 Meet Magit
;; (find-fline "/sda5/videos/")
(code-video "meetmagit" "/sda5/videos/meet_magit_504x380.flv")
;; (find-meetmagit)

http://stackoverflow.com/questions/5925372/how-to-use-git-from-emacs
http://news.ycombinator.com/item?id=1817324
http://blog.zawodny.com/2012/02/02/magit-makes-git-awesome-in-emacs/
http://zagadka.vm.bytemark.co.uk/magit/

# (find-status   "magit")
# (find-vldifile "magit.list")
# (find-udfile   "magit/")
# (find-node "(magit)Top")




#####
#
# magit (from the debian sources)
# 2013feb16
#
#####

# «magit-deb-src» (to ".magit-deb-src")
# http://ftp.de.debian.org/debian/pool/main/m/magit/
# http://ftp.de.debian.org/debian/pool/main/m/magit/magit_1.1.1-3.dsc
# http://ftp.de.debian.org/debian/pool/main/m/magit/magit_1.1.1-3.debian.tar.gz
# http://ftp.de.debian.org/debian/pool/main/m/magit/magit_1.1.1.orig.tar.gz
#*
rm -Rv ~/usrc/magit/
mkdir  ~/usrc/magit/
cd $S/http/ftp.de.debian.org/debian/pool/main/m/magit/
cp -v magit_1.1.1* ~/usrc/magit/
cd     ~/usrc/magit/
dpkg-source -sn -x magit_1.1.1-3.dsc
cd     ~/usrc/magit/magit-1.1.1/
dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb

#*
# (find-fline "~/usrc/magit/")
* (eepitch-shell)
cd ~/usrc/magit/
sudo dpkg -i *.deb

#*
# (code-c-d "magit" "~/usrc/magit/magit-1.1.1/")
# (find-magitfile "")



#####
#
# magit from git
# 2013aug27
#
#####

# «magit-from-git» (to ".magit-from-git")
# https://github.com/magit/magit
# https://github.com/magit/magit/blob/maint/INSTALL.md
# http://magit.github.io/magit/
# http://magit.github.io/magit/magit.html
# http://melpa.milkbox.net/#/
# http://melpa.milkbox.net/#/magit
# (find-enode "Regexps" "`+?'")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# rm -Rfv ~/usrc/magit/
cd ~/usrc/
  git clone --depth 1 https://github.com/magit/magit.git
# git clone           https://github.com/magit/magit.git
cd ~/usrc/magit/
git pull

rm -Rfv ~/usrc/magit/
cd ~/usrc/
git clone --depth 1 https://github.com/magit/magit.git
cd ~/usrc/magit/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd ~/usrc/magit/
git clean -dfx
git reset --hard

# emacs       -Q --batch -L . -f batch-byte-compile *.el
emacs-default -Q --batch -L . -f batch-byte-compile *.el
makeinfo -o magit.info magit.texi
rm -v ~/info/magit*
cp -v magit.info ~/info/
# (find-node "(magit)Top")
# (find-node "(~/usrc/magit/magit.info)Top")

# (add-to-list 'load-path "~/usrc/magit/")
# (require 'magit)

# (find-fline "~/usrc/magit/")
# (find-fline "~/usrc/magit/magit.info")
#  install-info --dir=$HOME/info magit.info
# ginstall-info --dir=$HOME/info magit.info
# (find-sh "ginstall-info --help")

# (find-zsh "dmissing cl-lib")

git branch
git checkout maint
git checkout master
make lisp docs

# (find-gitk "~/usrc/magit/")
# (magit-status "~/usrc/magit/")
# (find-sh "git --help")
# (find-man "1 git-checkout")


# (code-c-d "magit" "~/usrc/magit/")
# (find-magitfile "")
# (find-magitfile "INSTALL.md")
# (find-magitfile "INSTALL.md" "emacs -Q --batch")
# (find-magitfile "Makefile")
# (find-magitfile "Makefile" "install-all:")
# (find-magitsh "make -n lisp docs")

make PREFIX=$PATH install |& tee om
git pull

# (find-fline "~/usrc/magit/")

# https://github.com/magit/magit.git






#####
#
# Very hard reset
# 2013jan19
#
#####

# «very-hard-reset» (to ".very-hard-reset")
# http://stackoverflow.com/questions/61212/removing-untracked-files-from-your-git-working-copy
# (find-man "1 git-clean")
#
# I am looking for a standard way to do something equivalent to what
# the code below does - erasing everything but the .git/ directory,
# then doing a git reset to populate the working directory again...
#
# Maybe git clean -dfx? The stackoverflow link above has some hints...

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# Reset the working directory from the .git/ directory.
# This is MUCH stronger than a "make clean".
# (find-man "1 git-reset")
# (find-man "1 git-pull")
#
cd   ~/bigsrc/git/emacs/
find ~/bigsrc/git/emacs/ -maxdepth 1 -mindepth 1 | sort
find ~/bigsrc/git/emacs/ -maxdepth 1 -mindepth 1 | sort | grep -v '/\.git$'
rm -Rv $(
find ~/bigsrc/git/emacs/ -maxdepth 1 -mindepth 1 | sort | grep -v '/\.git$'
)
git pull

git clean -dfx
git reset --hard






#####
#
# Merging two different repos
# 2013feb10
#
#####

# «merge-different» (to ".merge-different")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/a/
rm -Rfv /tmp/b/
mkdir   /tmp/a/
mkdir   /tmp/b/
cp -av /sda6/nikon/containers/*.JPG /tmp/a/
cp -av /sda6/nikon/estantes/*.JPG   /tmp/b/
# (find-fline "/tmp/a/")
# (find-fline "/tmp/b/")
cd /tmp/a/ && git init && git add *.JPG && git commit -a -m "add a"
cd /tmp/b/ && git init && git add *.JPG && git commit -a -m "add b"
cd /tmp/a/ && git tag a
cd /tmp/b/ && git tag b
cd /tmp/a/
git remote rm  bs
git remote add bs  edrx@127.0.0.1:/tmp/b
git fetch      bs

# ^ The script above works.
#   The rest are just notes.

git clone edrx@127.0.0.1:/tmp/b
git fetch bs/master

git clone ssh://user@server:project.git


git://localhost/tmp/b/
git remote add bg git://localhost/tmp/b/
git fetch bg

git remote add b /tmp/b/
git remote
git fetch b
git merge b/master

git remote add t /tmp/
git remote
git remote rm t
git remote rm b


# (find-man "1 git-remote")
# (find-man "1 git-push")
# (find-man "1 git-branch")
# (find-man "1 git-clone")
# (find-man "1 git-pull")
# (find-man "1 git-fetch")

gitk . &

# (find-fline "/tmp/a/")
# (find-fline "/tmp/b/")




#####
#
# The default branch
# 2013feb23
#
#####

# «default-branch» (to ".default-branch")
# (find-man "1 git-checkout")
# (find-man "1 git-branch")
/usr/share/doc/git-doc/cmds-plumbingmanipulators.txt
# (find-gitdocfile "")
# (find-gitdocfile "cmds-plumbingmanipulators.txt")




#####
#
# git server
# 2013feb10
#
#####

# «git-server» (to ".git-server")
# http://git-scm.com/book/en/Git-on-the-Server-The-Protocols
# http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server



#####
#
# git-instaweb
# 2013feb01
#
#####

# «git-instaweb» (to ".git-instaweb")
# (find-es "http" "lighthttpd")
# (find-man "1 git-instaweb")
# (find-man "1 git-instaweb" "Default: lighttpd")



#####
#
# Not compressing big binary files
# 2013feb12
#
#####

# «not-compressing» (to ".not-compressing")
# http://stackoverflow.com/questions/540535/managing-large-binary-files-with-git
# https://github.com/apenwarr/bup

# http://superuser.com/questions/406907/why-is-git-so-slow-with-large-files
#   git set core.compression 0
# http://git.661346.n2.nabble.com/How-to-prevent-Git-from-compressing-certain-files-td3305492.html
# http://www.gitguys.com/topics/creating-a-shared-repository-users-sharing-the-repository/
# http://git-scm.com/book/en/Git-Tools-Submodules

# http://stackoverflow.com/questions/7102053/git-pull-without-remotely-compressing-objects
#   echo '*.zip -delta' > .gitattributes
#   git gc
# (find-man "5 gitattributes")
# (find-man "5 gitattributes" "Delta compression will not be attempted")
# (find-gitdocgrep "grep -nirH -e delta *")

# A test. Some lines were borrowed from:
#   (to "merge-different")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/a/
rm -Rfv /tmp/b/
mkdir   /tmp/a/
mkdir   /tmp/b/
cp -av /sda6/nikon/containers/*.JPG /tmp/a/
# (find-fline "/tmp/a/")
# (find-fline "/tmp/b/")
cd /tmp/a/
  git init
  git add *.JPG
  git commit -a -m "add a"
  git gc
  git gc
cd /tmp/b/
  time sshpass -p edrx git clone edrx@127.0.0.1:/tmp/a/

# Cloning into a...
# remote: Counting objects: 53, done.        
# remote: Compressing objects: 100% (53/53), done.        
# remote: Total 53 (delta 0), reused 0 (delta 0)        
# Receiving objects: 100% (53/53), 5.83 MiB | 3.37 MiB/s, done.
# sshpass -p edrx git clone edrx@127.0.0.1:/tmp/a/  1.32s user 0.25s system 37% cpu 4.163 total

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/a/
rm -Rfv /tmp/b/
mkdir   /tmp/a/
mkdir   /tmp/b/
cp -av /sda6/nikon/containers/*.JPG /tmp/a/
# (find-fline "/tmp/a/")
# (find-fline "/tmp/b/")
cd /tmp/a/
  echo '*.JPG -delta' > .gitattributes
  # git gc
  git init
  git add *.JPG
  git commit -a -m "add a"
  # git gc
  # git gc
cd /tmp/b/
  time sshpass -p edrx git clone edrx@127.0.0.1:/tmp/a/

# Cloning into a...
# remote: Counting objects: 53, done.        
# remote: Compressing objects: 100% (53/53), done.        
# remote: Total 53 (delta 0), reused 53 (delta 0)        
# Receiving objects: 100% (53/53), 5.83 MiB | 7.71 MiB/s, done.
# sshpass -p edrx git clone edrx@127.0.0.1:/tmp/a/  1.17s user 0.26s system 83% cpu 1.705 total



http://gitcasts.com/






#####
#
# git-annex
# 2013feb13
#
#####

# «git-annex» (to ".git-annex")
# (find-status   "git-annex")
# (find-vldifile "git-annex.list")
# (find-udfile   "git-annex/")
# http://git-annex.branchable.com/
# (find-fline "/usr/share/doc/git-annex/html/")
# file:///usr/share/doc/git-annex/html/index.html



#####
#
# diags (i.e., using git to help porting an article to dednat5)
# 2013jan25
#
#####

# «diags» (to ".diags")

# (find-git-links "~/" "git://" "diags" "diags")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
# (find-fline "~/diags/")
rm -Rfv ~/diags/
mkdir  ~/diags/
cd     ~/diags/
cp -v ~/LATEX/2010diags.tex .
git init
git add 2010diags.tex
git commit -m "initial"

cp -v ~/dednat4/examples/edrx08.sty .
cp -v ~/dednat4/examples/edrxdnt.tex .
cp -v ~/dednat4/examples/diagxy.tex .
cp -v ~/dednat4/examples/edrxdefs.tex .
cp -v ~/dednat4/examples/edrxheadfoot.tex .
cp -v ~/LATEX/frob-sketch.eps .
git add *.sty *.tex *.eps
git commit -m "added source dependencies"

# (find-fline "~/diags/2010diags.tex" ".eps")
# (find-man "1 git-commit")
git commit -a -m "fixed .eps"

epstopdf frob-sketch.eps
~/dednat4/dednat41 2010diags.tex
   latex 2010diags.tex
pdflatex 2010diags.tex

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
cd     ~/diags/
# (find-dn4exfile "")
# (find-dn4exfile "edrx08.sty")
cp -v ~/dednat4/examples/edrx08.sty .
cp -v ~/dednat4/examples/edrxdnt.tex .
cp -v ~/dednat4/examples/diagxy.tex .
cp -v ~/dednat4/examples/edrxdefs.tex .
cp -v ~/dednat4/examples/edrxheadfoot.tex .
~/dednat4/dednat41 2010diags.tex
cp -v ~/LATEX/frob-sketch.eps .
epstopdf frob-sketch.eps

latex 2010diags.tex
pdflatex 2010diags.tex

git add 2010diags.tex

#   git config --global user.email eduardoochs@gmail.com
# If the identity used for this commit is wrong, you can fix it with:
#   git commit --amend --author='Eduardo Ochs <eduardoochs@gmail.com>'

# (code-c-d "diags" "~/diags")
# (find-diagsfile "")
# (find-diagssh0 "gitk")




#####
#
# eev repository: using two branches
# 2013feb15
#
#####

# «eev-branches» (to ".eev-branches")
# (find-books "__comp/__comp.el" "git")
# (find-gitinternalspage  75 "Branching")




#####
#
# Git doesn't store mtimes
# 2013feb16
#
#####

# «mtimes» (to ".mtimes")
# (find-fline "~/LOGS/2013feb16.git")
# https://git.wiki.kernel.org/index.php/GitFaq#Why_isn.27t_Git_preserving_modification_time_on_files.3F

# (find-status   "etckeeper")
# (find-vldifile "etckeeper.list")
# (find-udfile   "etckeeper/")




#####
#
# git (from the debian sources)
# 2013feb23
#
#####

# «git-deb-src» (to ".git-deb-src")
# http://ftp.de.debian.org/debian/pool/main/g/git/
# http://ftp.de.debian.org/debian/pool/main/g/git/git_1.7.10.4-2.dsc
# http://ftp.de.debian.org/debian/pool/main/g/git/git_1.7.10.4-2.diff.gz
# http://ftp.de.debian.org/debian/pool/main/g/git/git_1.7.10.4.orig.tar.gz
#*
rm -Rv ~/usrc/git/
mkdir  ~/usrc/git/
cd $S/http/ftp.de.debian.org/debian/pool/main/g/git/
cp -v git_1.7.10.4* ~/usrc/git/
cd     ~/usrc/git/
dpkg-source -sn -x git_1.7.10.4-2.dsc
cd     ~/usrc/git/git-1.7.10.4/

find * -type f        | sort > .files
find * -name '*.[ch]' | sort > .files.ch
etags $(<.files.ch)

# dpkg-buildpackage -us -uc -b -rfakeroot     |& tee odb

#*
# (find-fline "~/usrc/git/")
* (eepitch-shell)
cd ~/usrc/git/
sudo dpkg -i *.deb

#*
# (code-c-d "gitsrc" "~/usrc/git/git-1.7.10.4/")
# (find-gitsrcfile "")
# (find-gitsrcfile ".files")
# (find-gitsrcfile ".files.ch")





#####
#
# Bare repos
# 2013feb24
#
#####

# «bare-repos» (to ".bare-repos")
# http://bare-vs-nonbare.gitrecipes.de/
# (find-fline "~/LOGS/2013feb24.git")
# (find-man "1 git-add")

# (find-man "1 git-rm")
# (find-man "1 git-commit")
# (find-es "git" "git-test")
# (find-books "__comp/__comp.el" "git")
# (find-fline "/tmp/git-a/")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
export PAGER=cat
export PS1="%d# "
N=0
  N () { echo $N; }
++N () { N=$[$N+1]; echo $N; }
Dump1   () { echo $1 \($(cat $1)\); }
Dumps   () { for i in $*; do Dump1 $i; done; }
Dump    () { Dumps $(find * -type f | sort); }
Modify1 () { ++N >> $1; Dump1 $1; }
Modify  () { for i in $*; do Modify1 $i; done; }

# My objective:
# to create a branch called "eev-0.95.3" with the files a,b,c,d,
#  and also a branch called "eev2"       with the files     c,d,e,f,
# and to be able to be able to push ("commit"?) new versions of files
# to both branches, without the switch to the other branch deleting
# the files that were only the previous branch...

# (find-gitinternalspage 24 "HEAD")
# (find-gitinternalstext 24 "HEAD")
# (find-gitinternalspage 113 "HEAD")
# (find-gitinternalstext 113 "HEAD")
# (find-man "1 git-checkout")
# (find-man "1 git-reset")
# (find-man "1 git-ls-files")
# (find-man "1 git-branch")
# (find-gitdocfile "")
# (find-gitdocfile "cmds-plumbinginterrogators.txt")

N=0
rm -Rf /tmp/git-a/
mkdir  /tmp/git-a/
cd     /tmp/git-a/
Modify a b c d e f g h
Dump
git init

git add a b c d
git commit -a -m 'Initial commit for eev-0.95.3'
git branch eev-0.95.3
  git log --oneline --graph --decorate --all

git rm --cached a b c d
git add c d e f
git branch eev2
git reset  eev2
git commit -a -m 'Initial commit for eev2'
  git log --oneline --graph --decorate --all

git checkout eev-0.95.3
Modify a
git commit -a -m 'changed a'
  git log --oneline --graph --decorate --all




N=0
rm -Rf /tmp/git-a/
mkdir  /tmp/git-a/
cd     /tmp/git-a/
Modify a b c
Dump
git init
git add a b c
git commit -a -m 'one'
  git log --oneline --graph --decorate --all

# (find-man "1 git-merge")
# (find-man "1 git-merge" "--ff-only")
# (find-man "git-branch")

git branch B1
#git reset  B1
 git checkout B1
git branch -d master
Modify a
git commit -a -m 'two'
  git log --oneline --graph --decorate --all

Modify a
git commit -a -m 'three'
  git log --oneline --graph --decorate --all




#####
#
# A prototype for what I need for the repo containing eev2 and eev-0.95.3
# 2013feb24
#
#####

# «eev2-and-0.95.3-prototype» (to ".eev2-and-0.95.3-prototype")
# «obsoletes-in-angg» (to ".obsoletes-in-angg")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
export PAGER=cat
export PS1="%d# "
N=0
  N () { echo $N; }
++N () { N=$[$N+1]; echo $N; }
Dump1   () { echo $1 \($(cat $1)\); }
Dumps   () { for i in $*; do Dump1 $i; done; }
Dump    () { Dumps $(find * -type f | sort); }
Modify1 () { ++N >> $1; Dump1 $1; }
Modify  () { for i in $*; do Modify1 $i; done; }

N=0
rm -Rf /tmp/git-a/
mkdir  /tmp/git-a/
cd     /tmp/git-a/
Modify a ab b c
git init
git add a ab
git commit -a -m 'one'
  git log --oneline --graph --decorate --all

git branch A
git branch B
#git reset  A
git checkout A
git branch -d master

Modify a
git commit -a -m 'two'
  git log --oneline --graph --decorate --all

git checkout B
  git log --oneline --graph --decorate --all

git rm --cached a ab
git add ab b
git commit -a -m 'three'
  git log --oneline --graph --decorate --all
  # * 988a945 (HEAD, B) three
  # | * b502c95 (A) two
  # |/  
  # * 0ef5bf2 one

git checkout $(git rev-list -n 1 HEAD)
git reset --soft A
  git log --oneline --graph --decorate --all

Modify a
git commit -a -m 'four'
  git log --oneline --graph --decorate --all



# **** test ****
# (find-man "1 git-checkout")
# (find-man "1 git-checkout" "\nDETACHED HEAD\n")
# (find-angg "bin/git-set-head")
#
git-set-head A
git commit -a -m '95 a'
git-set-head B





git checkout $(git rev-list -n 1 HEAD)
git reset --soft eev-0.95.3
  git log --oneline --graph --decorate --all


git checkout $(git rev-list -n 1 HEAD)



# Garbage:

Dump
# (find-man "1 git-rev-list")
               git rev-list -n 1 HEAD

#git reset A
git reset --soft A
#git checkout --conflict soft A
  git log --oneline --graph --decorate --all
  # * b502c95 (HEAD, B, A) two
  # * 0ef5bf2 one
  #
  # the "git reset" made the commit "three" sort of inaccessible... =(

# (find-man "1 git-checkout")
# (find-man "1 git-reset")

Dump

git rev-list --oneline HEAD

Modify f
git reset eev2
git commit -a -m 'changed f'
git rev-list --oneline HEAD

git log --oneline --graph --decorate --all

$ git log --pretty=format:"%h %s" --graph

*   9abcdef (eev-0.95.3,HEAD) changed b
| * 6789abc (eev2,master) changed f
| * 30e367c changed e
* | 5a09431 changed a
| * e1193f8 Initial commit for eev2
|/
* 11d191e Initial commit for eev-0.95.3

Dump
git reset eev-0.95.3
Dump

git reset eev-0.95.3

gitk &

# Create a commit that will be the root of the tree
# Is there a way to make an initial commit with no files?
git add c d
git commit -a -m 'Initial commit, with some files in the intersection'

git branch eev-0.95.3
git add a b c d
git commit -a -m 'Initial commit for eev-0.95.3'

git branch master
git add c d
git commit -a -m 'Initial commit for eev2'

gitk &




#####
#
# Detached HEAD
# 2013feb24
#
#####

# «detached-head» (to ".detached-head")
# (find-angg "bin/git-set-head")
# http://stackoverflow.com/questions/3965676/why-did-git-detach-my-head
# http://alblue.bandlem.com/2011/08/git-tip-of-week-detached-heads.html
# http://eclipsesource.com/blogs/2011/05/29/life-lesson-be-mindful-of-a-detached-head/
# http://sitaramc.github.com/concepts/detached-head.html




#####
#
# Gitorious
# 2013jul20
#
#####

# «gitorious» (to ".gitorious")
# eduardoochs B4
# https://gitorious.org/~eduardoochs

# (find-es "ssh" "ssh-keygen")

http://www.wikivs.com/wiki/GitHub_vs_Gitorious
http://noone.org/blog/English/Computer/VCS/Thoughts%20on%20Gitorious%20and%20GitHub%20plus%20a%20useful%20git%20hook.html
http://gitorious.org/
https://gitorious.org/users/new




#####
#
# Git instructions at Org
# 2013aug11
#
#####

# «org-contribute» (to ".org-contribute")
http://orgmode.org/worg/org-contribute.html ***




#####
#
# A simple git repository for eev
# 2013aug21
#
#####

# «eev-git-repo-simple» (to ".eev-git-repo-simple")
# (find-angg ".zshrc" "eev2-files")
# (find-zsh "eev2-files-all")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv /tmp/.git/
cd      /tmp/
git init
echo 0 > VERSION
git add VERSION
git commit -a -m 'Initial commit (empty repo)'

rm -Rfv ~/eev-current/.git/
cd      ~/eev-current/
git init
git add $(eev2-files-all)
git commit -a -m 'Initial commit for eev2'
# gitk &

# 2013aug26
git remote add origin https://github.com/edrx/eev.git
git push -u origin master


cd ~/eev-current/
git remote
git remote rm  rmt
# git remote add rmt file:///tmp/
git remote add rmt /tmp/
git remote -v
git push -f rmt

# (find-man "git-push")
# (find-sh "git push --help")
# (find-sh "git push --help" "fast-forward")





#####
#
# creating a bare repo and pushing to it
# 2013aug25
#
#####

# «create-bare-and-push» (to ".create-bare-and-push")
# http://pastebin.com/yqBhmRg0
# http://bare-vs-nonbare.gitrecipes.de/

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rf /tmp/public/
mkdir  /tmp/public/
cd     /tmp/public/
git init --bare

rm -Rf /tmp/here/
mkdir  /tmp/here/
cd     /tmp/here/
git clone /tmp/public/ .
echo 1 > VERSION
echo 2 > otherfile
git add VERSION otherfile
git commit -a -m 'Created a git repository'
git push origin master

# (find-fline "/tmp/public/")
# (find-gitk  "/tmp/public/")
# (find-fline "/tmp/here/")
# (find-gitk  "/tmp/here/")
# (find-fline "~/eev-current/")
# (find-gitk  "~/eev-current/")



* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rf /tmp/public/
mkdir  /tmp/public/
cd     /tmp/public/
git init --bare

# (find-fline "~/eev-current/")
rm -Rf ~/eev-current/.git/
cd     ~/eev-current/
git remote /tmp/public/
git add VERSION otherfile
git commit -a -m 'Created a git repository'
git push origin master

# (find-zsh "eev2-files-all")




#####
#
# changing the last commit message
# 2013aug28
#
#####

# «last-commit-message» (to ".last-commit-message")
# (find-man "git-commit")
# (find-man "git-commit" " --amend")
# (find-man "git-log")
# (find-man "git-log" "  oneline")
# (find-eevsh0 "PAGER=cat git log -1 --pretty=oneline")
# (find-eevsh0 "PAGER=cat git log -1 --pretty=tformat:%s")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
echo "a `echo foo` b"

cd ~/eev-current/
# (find-gitk "~/eev-current/")
git commit --amend -a -m "Added \`ee-copy-after-and' and \`find-eejumps'"
# (find-gitk "~/eev-current/")




#####
#
# The #git irc channel
# 2013aug28
#
#####

# «irc-channel» (to ".irc-channel")
# (find-freenode "#git")
# (find-freenode "gitinfo")
# http://jk.gs/git/bot/trigger.php





#####
#
# github guides
# 2017jul29
#
#####

# «github-guides» (to ".github-guides")
# https://guides.github.com/activities/hello-world/




#####
#
# Downloading the git tree for eev in verena
# 2017jul30
#
#####

# «eev-verena» (to ".eev-verena")

* (eepitch-shell)
* (eepitch-kill)
* (eepitch-shell)
rm -Rfv ~/usrc/eev/
cd      ~/usrc/
git clone https://github.com/edrx/eev
cd      ~/usrc/eev/
git ls-files
git ls-files > /tmp/of

cd ~/eev-current/
(TZ=GMT date; date) > VERSION
# cp -iv $(cat /tmp/of) ~/usrc/eev/
cp    -v $(cat /tmp/of) ~/usrc/eev/

cd      ~/usrc/eev/
git ls-files -m
git commit -a -m "First commit in two years; \`find-eev-quick-intro', \`to-latin1', and lots more"

# (find-fline "~/usrc/eev/")
# (find-fline "~/eev-current/")

rm -Rfv ~/eev-current/.git/
cp -av  ~/usrc/eev/.git ~/eev-current/



# (find-eev2-links)
# (find-git-links "https://github.com/edrx/eev" "ueev")
# (find-man "git-ls-files")
# (find-fline "~/usrc/")
# (find-fline "~/usrc/eev/")



















$ git branch -r
origin/master
$ git remote add linux-nfs git://linux-nfs.org/pub/linux/nfs-2.6.git
$ git remote
linux-nfs
origin
$ git fetch
* refs/remotes/linux-nfs/master: storing branch 'master' ...
  commit: bf81b46
$ git branch -r
origin/master
linux-nfs/master
$ git checkout -b nfs linux-nfs/master






# http://askubuntu.com/questions/27677/cannot-find-install-sh-install-sh-or-shtool-in-ac-aux
# http://sourceware.org/autobook/autobook/autobook_toc.html#SEC_Contents

find *                | sort > .files0
aclocal
autoconf         2>&1 | tee oa
./configure      2>&1 | tee oc
find * -name '*.[ch]' | sort > .files.ch
make bootstrap   2>&1 | tee omb
make TAGS        2>&1 | tee omT


(code-c-d "gitemacs" "~/bigsrc/git/emacs/")
;; (find-gitemacsfile "")
;; (find-gitemacssh "du -c")

# (find-es "emacs" "emacs-from-cvs")







# (find-freenode "#git")
http://jk.gs/git/bot/trigger.php






# (find-udfile "git-doc/")
# (find-udfile "git-doc/git-ls-files.txt")
# (find-udfile "git-doc/git-ls-tree.txt")
# (find-udfile "git-doc/" "cmds-")
# (find-udfile "git-doc/cmds-plumbinginterrogators.txt")





# (find-man "1 git-init")
# (find-man "1 git-add")
# (find-man "1 git-commit" "-m <msg>,")
# (find-man "1 git-checkout" "-b\n")
git checkout -b my-patch
git checkout master
git checkout my-patch


git archive --format=tar --prefix=loopa-0.0.4/ v0.0.4 | gzip > ~/Desktop/loopa-0.0.4.tar.gz
 
http://savannah.gnu.org/maintenance/UsingGit

Or just publish a read-only, static HTTP mirror without any prior history ,
and from then on mind the comments.
       git clone --mirror --depth=1
Then from a cronjob run
       cd http-repo && git fetch && git --bare update-server-info



https://github.com/blog/1302-goodbye-uploads



cd ~/eev-current/
git add -a




#  Local Variables:
#  coding:               raw-text-unix
#  ee-delimiter-hash:    "\n#*\n"
#  ee-delimiter-percent: "\n%*\n"
#  ee-anchor-format:     "«%s»"
#  End: