background preloader

Tech Talk: Linus Torvalds on git

Tech Talk: Linus Torvalds on git
Related:  Git git

Git tortoisegit - Where are git database files stored on windows The Git Parable Git is a simple, but extremely powerful system. Most people try to teach Git by demonstrating a few dozen commands and then yelling “tadaaaaa.” I believe this method is flawed. Such a treatment may leave you with the ability to use Git to perform simple tasks, but the Git commands will still feel like magical incantations. Doing anything out of the ordinary will be terrifying. Until you understand the concepts upon which Git is built, you’ll feel like a stranger in a foreign land. The following parable will take you on a journey through the creation of a Git-like system from the ground up. The Parable Imagine that you have a computer that has nothing on it but a text editor and a few file system commands. Snapshots Alfred is a friend of yours that works down at the mall as a photographer in one of those “Special Moments” photo boutiques. You start your project in a directory named working. Branches After a bit of time on the project, a candidate for release begins to emerge. Branch Names

tortoisegit - Porting TortoiseSVN to TortoiseGit Git Version of TortoiseSVN. It is a port of TortoiseSVN for Git. TortoiseGit supports you by regular tasks, such as committing, showing logs, diffing two versions, creating branches and tags, creating patches and so on (see our Screenshots or documentation). You're welcome to contribute to this project (help on coding, documentation, Translation, testing preview releases or helping other users on the mailing lists is really appreciated). If you upgraded to TortoiseGit 1.8.8.0 and TortoisePLink reports "missing MSVCR110.dll", go to TortoiseGit settings, Network and select "TortoiseGitPLink.exe" as ssh client (which is located in the TortoiseGit\bin directory; issue #2156 ). There seems to be a bug in the MFC library, so please make sure you have the latest service pack installed. The latest and recommended release of TortoiseGit is: 1.8.8.0, see ReleaseNotes for details. Download TortoiseGit System prerequisites and installation howto Get a full list of screenshots. Context menu Commit Dialog

First-Time Git Setup Now that you have Git on your system, you’ll want to do a few things to customize your Git environment. You should have to do these things only once; they’ll stick around between upgrades. You can also change them at any time by running through the commands again. Git comes with a tool called git config that lets you get and set configuration variables that control all aspects of how Git looks and operates. These variables can be stored in three different places: /etc/gitconfig file: Contains values for every user on the system and all their repositories. On Windows systems, Git looks for the .gitconfig file in the $HOME directory (%USERPROFILE% in Windows’ environment), which is C:\Documents and Settings\$USER or C:\Users\$USER for most people, depending on version ($USER is %USERNAME% in Windows’ environment). Your Identity The first thing you should do when you install Git is to set your user name and e-mail address. Your Editor $ git config --global core.editor emacs Your Diff Tool

Git Basics So, what is Git in a nutshell? This is an important section to absorb, because if you understand what Git is and the fundamentals of how it works, then using Git effectively will probably be much easier for you. As you learn Git, try to clear your mind of the things you may know about other VCSs, such as Subversion and Perforce; doing so will help you avoid subtle confusion when using the tool. Git stores and thinks about information much differently than these other systems, even though the user interface is fairly similar; understanding those differences will help prevent you from becoming confused while using it. Snapshots, Not Differences The major difference between Git and any other VCS (Subversion and friends included) is the way Git thinks about its data. Figure 1-4. Git doesn’t think of or store its data this way. Figure 1-5. This is an important distinction between Git and nearly all other VCSs. Nearly Every Operation Is Local Git Has Integrity Git Generally Only Adds Data

Recherche et téléchargement de fichiers sur Github Github est un service formidable où les gens stockent leurs codes sources et leurs projets... Mais c'est aussi une mine d'or de fichiers en tout genre. Certains utilisateurs de Github font d'ailleurs preuve de négligence et synchronisent même parfois des fichiers contenant des mots de passe en clair ou des infos plus ou moins confidentielles. Pour effectuer ce genre de recherches sur Github, il existe un petit script python qui permet tout simplement de récupérer sur votre ordinateur, les fichiers qui vous intéressent. Par exemple, en tapant : . vous récupérerez tous les historiques bash qui trainent. . vous récupérerez tous les htpasswd qui trainent . vous récupérez des boites mails qui trainent . et des logins/passwords de connexions à des bases de données. Je ne passe pas tout en revue. Pour installer ghrabber, il faut faire un petit : sudo easy_install pip sudo pip install beautifulsoup requests Puis téléchargez ghrabber ici. Vous avez aimé cet article ?

Git One of the things I didn't touch on at all in the book is the git rerere functionality. This also came up recently during one of my trainings, and I realize that a lot of people probably could use this, so I wanted to let you all now about it. The git rerere functionality is a bit of a hidden feature (Git actually has a lot of cool hidden features, if you haven't figured that out yet). There are a number of scenarios in which this functionality might be really handy. This same tactic can be used if you want to keep a branch rebased so you don't have to deal with the same rebasing conflicts each time you do it. The other situation I can think of is where you merge a bunch of evolving topic branches together into a testable head occasionally. To enable the rerere functionality, you simply have to run this config setting: $ git config --global rerere.enabled true Now let's see a simple example. #! When we merge the two branches together, we'll get a merge conflict: Our merge is undone.

Migrer d'un serveur git à un autre Dans une entreprise, ça bouge beaucoup, et en général, le code suit le mouvement… Si vous voulez migrer du code d’un serveur git à un autre, alors il y a une méthode toute simple : utiliser le script ci-dessous. C’est tout simple, il suffit de copier / coller le script dans un fichier et de le lancer en ligne de commande. Il faudra toutefois, avant les réjouissances, paramétrer quelques variables d’environnement, en tapant simplement (et par exemple) : GIT_SERVER_FROM=git@github.cedrik.frGIT_SERVER_TO=git@gitlab.digitas.frREPO_PREFIX=:myproject/REPOS= »core module1 module2″ Cela migrera : les projets : core + module1 + module2à partir de : git@github.cedrik.fr:myproject/Vers : git@gitlab.digitas.fr:myproject/ Et voilà ! [Ce script a été vu pour la première fois sur TechRevolutions.fr] Vous aimez cet article ? Partage

Git Reference Getting and Creating Projects In order to do anything in Git, you have to have a Git repository. This is where Git stores the data for the snapshots you are saving. There are two main ways to get a Git repository. docs book git init initializes a directory as a Git repository To create a repository from an existing directory of files, you can simply run git init in that directory. $ cd konnichiwa$ ls README hello.rb This is a project where we are writing examples of the "Hello World" program in every language. $ git init Initialized empty Git repository in /opt/konnichiwa/.git/ Now you can see that there is a .git subdirectory in your project. $ ls -a . .. .git README hello.rb Congratulations, you now have a skeleton Git repository and can start snapshotting your project. In a nutshell, you use git init to make an existing directory of content into a new Git repository. docs book git clone copy a git repository so you can add to it On to Basic Snapshotting »

Related: