background preloader

Git

Facebook Twitter

Using Git to manage a web site. The HTML source for my (i.e., this) web site lives in a Git repository on my local workstation. This page describes how I set things up so that I can make changes live by running just "git push web". The one-line summary: push into a remote repository that has a detached work tree, and a post-receive hook that runs "git checkout -f". The local repository It doesn't really matter how the local repository is set up, but for the sake of argument, let's suppose you're starting one from scratch. $ mkdir website && cd website $ git init Initialized empty Git repository in /home/ams/website/.git/ $ echo 'Hello, world! ' > index.html $ git add index.html $ git commit -q -m "The humble beginnings of my web site. " Anyway, however you got there, you have a repository whose contents you want to turn into a web site. The remote repository On the server, we create a new repository to mirror the local one. $ mkdir /var/www/www.example.org $ cat > hooks/post-receive #!

The update process $ git push web Notes. Préface. Git est un couteau suisse de la gestion de versions. Un outil de gestion de révisions multi-usage, pratique et fiable, dont la flexibilité en rend l’apprentissage pas si simple, sans parler de le maîtriser ! Comme Arthur C. Clarke le fait observer, toute technologie suffisamment avancée se confond avec la magie. C’est une approche intéressante pour Git : les débutants peuvent ignorer ses mécanismes internes et l’utiliser comme une baguette magique afin d'époustoufler les amis et rendre furieux les ennemis par ses fabuleuses capacités. Plutôt que de rentrer dans le détails, nous donnons des instructions pour obtenir tel ou tel effet. Je reste modeste devant le travail fourni par tant de monde pour traduire ces pages. Dustin Sallings, Alberto Bertogli, James Cameron, Douglas Livingstone, Michael Budde, Richard Albury, Tarmigan, Derek Mahar, Frode Aannevik, Keith Rarick, Andy Somerville, Ralf Recker, Øyvind A.

François Marier maintient le paquet Debian, créé à l’origine par Daniel Baumarr. Understanding Git Conceptually. Introduction This is a tutorial on the Git version control system. Git is quickly becoming one of the most popular version control systems in use. There are plenty of tutorials on Git already. How is this one different? A Story When I first started using Git, I read plenty of tutorials, as well as the user manual. Though I picked up the basic usage patterns and commands, I never felt like I grasped what was going on “under the hood,” so to speak. After a few months, I started to understand those under-the-hood concepts. Understanding Git The conclusion I draw from this is that you can only really use Git if you understand how Git works.

Half of the existing resources on Git, unfortunately, take just that approach: they walk you through which commands to run when, and expect that you should do fine if you just mimic those commands. This tutorial, then, will take a conceptual approach to Git. Go on to the next page: Repositories. Git Quick Reference. Aha! Moments When Learning Git. Git is a fast, flexible but challenging distributed version control system. Before jumping in: Along with a book, tutorial and cheatsheet, here are the insights that helped git click.

There's a staging area! Git has a staging area. Git has a staging area!!! Yowza, did this ever confuse me. Git add foo.txtAdd foo.txt to the index. Why stage? But now there's two undos: git checkout foo.txtUndo local changes (like svn revert)git reset HEAD foo.txtRemove from staging area (local copy still modified). Add and commit, add and commit -- Git has a rhythm. Branching is "Save as... " Branches are like "Save as... " on a directory. Easily merge changes with the original (changes tracked and never applied twice)No wasted space (common files only stored once) Why branch? Imagine virtual directories I see branches as "virtual directories" in the .git folder. The physical directory is a scratchpad. Know the current branch Just like seeing your current directory, put the current branch in your prompt!

Local data. Gérez vos codes source avec Git. Tower - The most powerful Git client for Mac. Installing git (OSX) If you've found yourself on this page, we're assuming you're brand new to Git and GitHub. This guide will walk you through the basics and explain a little bit about how everything works along the way. Download and Install Git At the heart of GitHub is an open source version control system (VCS) called Git*. Created by the same team that created Linux, Git is responsible for everything GitHub related that happens locally on your computer. *If you don't already know what Git is, take a crash course.

Download and install the latest version of Git. Use the default options for each step. Warning: Do not use PuTTY if you are given the option. Set Up Git Now that you have Git installed, it's time to configure your settings. Now that you have Git installed, it's time to configure your settings. Now that you have Git installed, it's time to configure your settings. Now that you have Git installed, it's time to configure your settings. Need a quick lesson about TerminalTerminalGit Bashthe command line?