Changes

Jump to navigation Jump to search
343 bytes added ,  13:49, 9 April 2024
m
Line 69: Line 69:  
===Full copy of remote repository:===
 
===Full copy of remote repository:===
 
  <nowiki>#!/bin/bash
 
  <nowiki>#!/bin/bash
for branch in `git branch -r | grep -v HEAD | grep -v master`; do
+
  for branch in `git branch -r | grep -v HEAD | grep -v master`; do
    echo ${branch##*/} $branch
+
      echo ${branch##*/} $branch
done
+
  done
git fetch --all
+
  git fetch --all
git pull -v</nowiki>
+
  git pull -v</nowiki>
    
==Add .gitignore==
 
==Add .gitignore==
Line 89: Line 89:  
  git config --global user.email "user@domain.com"
 
  git config --global user.email "user@domain.com"
   −
=== Default editor ===
+
===Default editor===
 
<syntaxhighlight lang="bash">
 
<syntaxhighlight lang="bash">
 
git config core.editor "nano -w"
 
git config core.editor "nano -w"
Line 123: Line 123:     
   
 
   
 +
== Create git aliases ==
    +
=== count-lines Alias ===
 +
<syntaxhighlight lang="bash">
 +
git config --global alias.count-lines "! git log --author=\"\$1\" --pretty=tformat: --numstat | awk '{ add += \$1; subs += \$2; loc += \$1 - \$2 } END { printf \"added lines: %s, removed lines: %s, total lines: %s\n\", add, subs, loc }' #"
 +
</syntaxhighlight>
    
==Cheat Sheet==
 
==Cheat Sheet==
 
http://wiki.herrerosolis.com/images/4/46/Git-cheat-sheet.pdf
 
http://wiki.herrerosolis.com/images/4/46/Git-cheat-sheet.pdf

Navigation menu