Xfce Wiki

Sub domains
 

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
dev:howto:git [2009/08/13 23:46] – add url to DOAP website kelnosdev:howto:git [2009/08/14 04:26] kelnos
Line 93: Line 93:
 ===== Tips and Tricks ===== ===== Tips and Tricks =====
  
-==== Shortcut URLS ==== +See [[dev:howto:git-tips-and-tricks]].
- +
-If you clone a lot of Xfce repositories, you can set a shortcut so you don't have to type out the full URL all the time.  Simply run: +
- +
-<code>git config --global 'url.ssh://git.xfce.org/git/.insteadOf' xfce:</code> +
- +
-After this, you'll be able to do, for example: +
- +
-<code>git clone xfce:xfce/xfdesktop</code> +
- +
-and Git will automatically rewrite it to the correct URL.  You can of course do this with git: and http: URLs as well. +
- +
-==== Different Local Username? ==== +
- +
-If your ssh username is not the same as your local username, you can make an entry in ''$HOME/.ssh/config'' (create it if it doesn't exist) so you don't have to type it each time: +
- +
-<code>Host git.xfce.org +
-    User $USERNAME</code> +
- +
-Of course, replace ''$USERNAME'' with your actual username.+
  
 ===== Migrating From git-svn Clones ===== ===== Migrating From git-svn Clones =====
Line 127: Line 108:
 $ git checkout master $ git checkout master
 $ git checkout -b new-drawing $ git checkout -b new-drawing
-$ git pull ../xfdesktop.git-svn new-drawing:refs/heads/tmpbranch +$ git fetch ../xfdesktop.git-svn new-drawing:refs/heads/tmpbranch
-$ git reset --hard new-drawing+
 $ git log tmpbranch</code> $ git log tmpbranch</code>
  
Line 142: Line 122:
 <code>$ git cherry-pick d1e0179e8b6f00e4f452513c100f674f7d35dc11 <code>$ git cherry-pick d1e0179e8b6f00e4f452513c100f674f7d35dc11
 $ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</code> $ git cherry-pick e3633d52774bd9a2a20ef9af37d3f72f964a2f54</code>
 +
 +(Note: if there's only one commit to merge, you can skip the above and just do ''git cherry-pick tmpbranch'', which will just cherry pick the ''HEAD'' commit of ''tmpbranch''.)
  
 Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first: Now, if I got any merge errors after one of the cherry pick commands, I'd have to stop there and fix it up first:
Line 160: Line 142:
  
 You'll have to repeat this process for any other local branch you have in the old git-svn clone.  As I said, yes, it's annoying, repetitive, manual, and time-consuming (if you have a lot of branches/clones to convert).  If anyone knows a better way, feel free to detail it here. You'll have to repeat this process for any other local branch you have in the old git-svn clone.  As I said, yes, it's annoying, repetitive, manual, and time-consuming (if you have a lot of branches/clones to convert).  If anyone knows a better way, feel free to detail it here.
 +
 +After you finish with all branches in a particular module, you may want to run:
 +
 +<code>$ git gc --prune=now</code>
 +
 +This will remove all the dangling commits, trees, and blobs left over from the probably-large number of mismatched objects discarded when you deleted tmpbranch.