Difference between revisions of "Learning more about git"

From Wiki for iCub and Friends
Jump to: navigation, search
(Bash Prompt)
(More)
Line 37: Line 37:
  
 
== More ==
 
== More ==
 +
 +
Git homepage
 +
 +
  http://git-scm.com/
  
 
A few more setup tricks can be found here:
 
A few more setup tricks can be found here:
Line 46: Line 50:
 
   http://git-scm.com/documentation
 
   http://git-scm.com/documentation
  
More tutorials can be found here:
+
Try git in your browser:
 +
 
 +
  http://try.github.com/
 +
 
 +
LearnGitBranching - Web application designed to help beginners grasp the powerful concepts behind branching
 +
 
 +
  http://pcottle.github.io/learnGitBranching/
 +
 
 +
Git reference:
 +
 
 +
  http://gitref.org/
 +
 
 +
A Visual Git Reference:
  
   http://sixrevisions.com/resources/git-tutorials-beginners/
+
   http://marklodato.github.io/visual-git-guide/index-en.html
  
 
If you are a subversion user, you might find useful this crash course for svn users. Please note that git and svn workflows are slightly different, this is only supposed to be used as reference.
 
If you are a subversion user, you might find useful this crash course for svn users. Please note that git and svn workflows are slightly different, this is only supposed to be used as reference.
  
 
   http://git.or.cz/course/svn.html
 
   http://git.or.cz/course/svn.html
 +
 +
Git documentation wiki (contains several links):
 +
 +
  https://git.wiki.kernel.org/index.php/GitDocumentation
 +
 +
CMake Git resources (more links):
 +
 +
  http://www.cmake.org/Wiki/Git/Resources
 +
 +
More tutorials can be found here:
 +
 +
  http://sixrevisions.com/resources/git-tutorials-beginners/

Revision as of 16:41, 7 May 2014

If you are not familiar with git we suggest at least you learn the basics. The official and comprehensive man pages are included in the Git package itself. You can access to them with:

  git --help
  git <command> --help

Quick Git Setup

Setup SSH Keys

You can use git with https, but this requires to insert the username and password every time you need to push on the server (and to fetch or pull if the repository is private). Using ssh will save you some precious time. In order to use ssh you have to create an ssh key and add it to your profile on GitHub.

Your Identity

The first thing you should do is to set your user name and e-mail address.

 git config --global user.name "John Doe"
 git config --global user.email "john.doe@example.com"

Some Color

If you use git mostly from the command line, colors are very useful, you can enable them by running:

 git config --global color.pager true
 git config --global color.ui auto

Bash Prompt

Bash prompt can be tweaked to show you in which branch you are by using __git_ps1. For example you can replace your default prompt in your ~/.bashrc file with:

 if [ "$color_prompt" = yes ]; then
     PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\[\033[00;32m\]$(__git_ps1 " (%s)")\[\033[00m\]\$ '
 else
     PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w$(__git_ps1 " (%s)")\$ '
 fi

More

Git homepage

  http://git-scm.com/

A few more setup tricks can be found here:

  http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup

A very comprehensive source of documentation is this:

  http://git-scm.com/documentation

Try git in your browser:

  http://try.github.com/

LearnGitBranching - Web application designed to help beginners grasp the powerful concepts behind branching

  http://pcottle.github.io/learnGitBranching/

Git reference:

  http://gitref.org/

A Visual Git Reference:

  http://marklodato.github.io/visual-git-guide/index-en.html

If you are a subversion user, you might find useful this crash course for svn users. Please note that git and svn workflows are slightly different, this is only supposed to be used as reference.

  http://git.or.cz/course/svn.html

Git documentation wiki (contains several links):

  https://git.wiki.kernel.org/index.php/GitDocumentation

CMake Git resources (more links):

  http://www.cmake.org/Wiki/Git/Resources

More tutorials can be found here:

  http://sixrevisions.com/resources/git-tutorials-beginners/