meta data for this page
  •  

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
git:start [2016/09/07 07:31] niziakgit:start [2023/05/30 10:29] (current) niziak
Line 1: Line 1:
-GIT PAGE +====== GIT ====== 
-==== Preparation ====+ 
 +====== Preparation ====== 
 === git-email === === git-email ===
 <code bash> <code bash>
Line 7: Line 9:
 git config sendemail.suppressfrom true git config sendemail.suppressfrom true
 </code> </code>
 +
 +=== replace github's git: links ===
 +NOTE: Github was disabled git protocol. So only ''https:'' or ssh ''git@'' is valid.
 +
 +<code bash>
 +git config --global url.https://github.com/daurnimator/lua-systemd.insteadOf git://github.com/daurnimator/lua-systemd
 +# or
 +git config --global url.https://.insteadOf git://
 +</code>
 +
 +Keywords: git protocol, ''git:'' protocol
 +
 +=== replace github https links ===
 +<code bash>git config --global url.git@github.com:.insteadOf https://github.com/</code>
 +
 +====== Import HG (mercurial) repo ======
 +<code bash>
 +sudo apt-get install hg-fast-export
 +git init
 +hg-fast-export -r .
 +</code>
 +
 +
 +====== Usage ======
 +
 +==== fetch moved tags ====
 +<code bash>git fetch origin --tags --force</code>
  
 ==== Undo a commit ==== ==== Undo a commit ====
Line 18: Line 47:
 $ git commit -c ORIG_HEAD      $ git commit -c ORIG_HEAD     
 </code> </code>
 +
  
 ==== Local copy of one branch from public repo ==== ==== Local copy of one branch from public repo ====
Line 35: Line 65:
 <code bash>git push -u gitlab</code> <code bash>git push -u gitlab</code>
  
-==== Debug ====+==== repo clean and repack ==== 
 +<code bash> 
 +git reflog expire --expire=1.minute refs/heads/master 
 +git fsck --unreachable       
 +git prune                    
 +git gc                 
 +</code> 
 + 
 +====== Debug ======
 <code bash> <code bash>
 GIT_TRACE=1 git clone ... GIT_TRACE=1 git clone ...