Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Commons Wiki" for 
change notification.

The "UsingGIT" page has been changed by LucMaisonobe:
https://wiki.apache.org/commons/UsingGIT?action=diff&rev1=6&rev2=7

  = Git References =
  
  There are numerous references available online for Git. The first one is the 
official [[http://git-scm.com/book/en/|Pro Git book]].<<BR>>
+ A quick Git reference: [[http://gitref.org/|Git Reference]].<<BR>>
  An Apache specific page is [[https://git-wip-us.apache.org/|here]].<<BR>>
  There is also a wiki at kernel.org: [[https://git.wiki.kernel.org/|Git Wiki 
Homepage]].<<BR>>
  Also a quick tutorial on [[http://git.or.cz/course/svn.html|Git for SVN 
users]].
  Eclipse users could have a look at 
[[http://www.vogella.com/tutorials/EclipseGit/article.html|Git version control 
with Eclipse (EGit) - Tutorial]].
+ 
+ 
+ = Git configuration =
+ 
+ The configuration for the local Git client is stored at two different levels. 
There is a `global` configuration
+ (typically in your home directory) where you can put everything that will 
remain the same accross all repositories
+ you clone, and there is a `local` configuration in each repository. You can 
modify and list configuration keys and
+ values using the `git config` command. Before you try anything else (even 
before you clone your first repository),
+ you should configure at least configure one parameter: the `core.autocrlf` 
setting. This setting will adapt the
+ line-ending conversion done between the Apache repository and your workspace.
+ 
+ If you are using MacOSX or Linux, you should run: { { {
+   git config --global core.autocrlf input`
+ } } }
+ 
+ If you are using Windows, you should run: { { {
+   git config --global core.autocrlf true
+ } } }
+ 
+ 
+ The first setting forces Git to only strip accidental CR/LF when committing 
into the repository, but never when cheking
+ out files from the repository. The second setting forces Git to convert CR/LF 
line endings in the workspace while maintaining
+ LF only line endings in the repository.
+ 
+ If for some reason some specific files needs to be checked in with specific 
conversion (or without conversion at all),
+ they can be specified in a ``.gitattributes`` file. For example, you can 
force files to be handled as text, or on
+ the contrary to never be considered as text and therefore not converted: { { {
+   # general pattern for files known to be text: End Of Line transformations 
will be done
+   *.apt                               text
+   *.html                              text
+   *.java                              text
+   *.properties                        text
+   *.puml                              text
+   *.svg                               text
+   *.txt                               text
+   *.xml                               text
+   *.fml                               text
+ 
+   # general pattern for files known to not be text: no End Of Line 
transformations will be done
+   *.gz                               -text
+   *.zip                              -text
+   *.ico                              -text
+   *.xcf                              -text
+   *.jpg                              -text
+   *.odg                              -text
+   *.png                              -text
+ 
+   # specific data files known to be text: End Of Line transformations will be 
done
+   .gitattributes                      text
+   .gitignore                          text
+   .checkstyle                         text
+ 
+   # specific data files known to not be text: no End Of Line transformations 
will be done
+   src/*/resources/*/weird-*-binary-file  -text
+ } } }
+ 
+ Two other important parameters should be set, but they may need to be set on 
a per-repository
+ basis, in case you have different usernames and mail addresses for Apache and 
non-Apache projects.
+ In this case, the following comands must be run after you have cloned the 
repository, and they
+ should be run from inside the cloned workspace: { { {
+   git config --local user.name "You Name"
+   git config --local user.email apach...@apache.org
+ } } }
  
  = Comparison with subversion commands =
  
@@ -88, +152 @@

     `git remote -v` and `git remote origin`
  
   * `svn cp` ''https://svn.apache.org/.../trunk'' 
''https://svn.apache.org/.../tags/my-tag'' `-m message`
-    `git tag -m message MY_TAG` (or better, add also -s or -u option to create 
a cryptographically signed tag)
+    `git tag -m message my-tag` (or better, add also -s or -u option to create 
a cryptographically signed tag)
     if you want the tag to also be on Apache servers, you should `git push 
origin my-tag` to push it to the origin remote repository)
  
   * `svn cp` ''https://svn.apache.org/.../trunk'' 
''https://svn.apache.org/.../branches/my-branch'' `-m message`

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org
For additional commands, e-mail: dev-h...@commons.apache.org

Reply via email to