User Tools

Site Tools


programming:git:git

Differences

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

Link to this comparison view

Next revision
Previous revision
Last revisionBoth sides next revision
programming:git:git [2019/05/07 06:54] – created maferreiraprogramming:git:git [2021/08/02 09:51] – [Clone only one directory] sbolay
Line 1: Line 1:
-===== Clone only directory ===== +====== Git ====== 
-    git clone <git path> +===== Clone only one directory ===== 
-    cd <git directory> +  git clone <git path> 
-    git config core.sparsecheckout true +  cd <git directory> 
-    echo "<directory name>" >> .git/info/sparse-checkout +  git config core.sparsecheckout true 
-    git checkout --+  echo "<directory name>" >> .git/info/sparse-checkout 
 +  git checkout -- 
 + 
 +Reference : https://git-scm.com/book/en/v2 
 + 
 + 
 +===== Git pull ===== 
 +git pull runs git fetch with the given parameters and calls git merge to merge the retrieved branch heads into the current branch 
 + 
 +<note> 
 +Pulling without specifying how to reconcile divergent branches is 
 +discouraged. You can squelch this message by running one of the following 
 +commands sometime before your next pull: 
 + 
 +  git config pull.rebase false  # merge (the default strategy) 
 +  git config pull.rebase true   # rebase 
 +  git config pull.ff only       # fast-forward only 
 + 
 +You can replace "git config" with "git config --global" to set a default 
 +preference for all repositories. You can also pass --rebase, --no-rebase, 
 +or --ff-only on the command line to override the configured default per invocation. 
 +</note> 
 + 
 +  git config --global pull.rebase true 
 + 
 +Reference : https://git-scm.com/docs/git-pull \\ 
 +Exemple : https://dev.to/mliakos/don-t-git-pull-use-git-pull-rebase-instead-5b8k 
programming/git/git.txt · Last modified: 2022/04/12 06:19 by ateixeira