Git: Difference between revisions

From dankwiki
No edit summary
(automatic remote branch pruning)
Line 39: Line 39:
===Prune remote branches===
===Prune remote branches===
<tt>git remote prune origin</tt>
<tt>git remote prune origin</tt>
This can be made automatic with <tt>git config remote.origin.prune true</tt> since git 1.8.5.
* Tv's "[ Git for Computer Scientists]"
* Tv's "[ Git for Computer Scientists]"

Revision as of 10:41, 25 November 2019

Here's a good crash course for subversion users.


  • GitHub provides pretty reasonable git hosting services; open source projects eat free.
  • github-trac is a trac extension for working with GitHub
  • Remote repacks/compressions can consume a great deal of memory. To cap the remote packing at, say, 2G, enter the remote repository and run:
git config pack.windowMemory 1000m
git config pack.packSizeLimit 2000m


Dump your user configuration with git config -l:

[recombinator](129) $ git config -l Black
[recombinator](0) $

Dump the system configuration, if one exists, via git config --system -l:

[recombinator](129) $ git config --system -l
[recombinator](0) $

Subversion equivs

goal subversion git
Add an external repository repo at point dir/path svn propedit svn:externals dir, and add repo path git submodule add repo dir/path (there's a Submodule Tutorial)


Create bare repo from existing files

We have existing, untracked files at workpath. We want to initialize a (possibly remote) bare repository repo with the contents of workpath.

  • In repo/, run git init --bare
  • In workpath/, run git init
  • In workpath/, run git remote add origin repo
  • In workpath/, run git add .
  • In workpath/, run git push

Prune remote branches

git remote prune origin This can be made automatic with git config remote.origin.prune true since git 1.8.5.