background preloader

Git for Computer Scientists

Git for Computer Scientists
Abstract Quick introduction to git internals for people who are not scared by words like Directed Acyclic Graph. Storage In simplified form, git object storage is "just" a DAG of objects, with a handful of different types of objects. They are all stored compressed and identified by an SHA-1 hash (that, incidentally, isn't the SHA-1 of the contents of the file they represent, but of their representation in git). blob: The simplest object, just a bunch of bytes. tree: Directories are represented by tree object. When a node points to another node in the DAG, it depends on the other node: it cannot exist without it. commit: A commit refers to a tree that represents the state of the files at the time of the commit. refs: References, or heads or branches, are like post-it notes slapped on a node in the DAG. git commit adds a node to the DAG and moves the post-it note for current branch to this new node. The HEAD ref is special in that it actually points to another ref. History

Preface Git is a version control Swiss army knife. A reliable versatile multipurpose revision control tool whose extraordinary flexibility makes it tricky to learn, let alone master. As Arthur C. Rather than go into details, we provide rough instructions for particular effects. I’m humbled that so many people have worked on translations of these 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 maintains the Debian package originally created by Daniel Baumann. My gratitude goes to many others for your support and praise. If I’ve left you out by mistake, please tell me or just send me a patch! This guide is released under the GNU General Public License version 3. $ git clone # Creates "gitmagic" directory. or from one of the mirrors:

Chapter 3. Cloning Around Chapter 3. Cloning Around In older version control systems, checkout is the standard operation to get files. You retrieve a bunch of files in a particular saved state. In Git and other distributed version control systems, cloning is the standard operation. To get files, you create a clone of the entire repository. I can tolerate making tarballs or using rsync for backups and basic syncing. Initialize a Git repository and commit your files on one machine. $ git clone to create a second copy of the files and Git repository. $ git commit -a $ git pull HEAD will pull in the state of the files on the other computer into the one you’re working on. Initialize a Git repository for your files: $ git init $ git add . $ git commit -m "Initial commit" On the central server, initialize a bare repository in some directory: $ mkdir proj.git $ cd proj.git $ git --bare init $ touch proj.git/git-daemon-export-ok Start the Git daemon if necessary:

How to create patch file using patch and diff November 23rd, 2006 mysurface Posted in Developer, diff, Misc, patch | Hits: 323569 | 14 Comments » Okay, this is what I do. I only know the basic. But before doing this, please backup your source code, patch wrongly will screwup your source code. First, how to create patch file? Assume Original source code at folder Tb01, and latest source code at folder Tb02. diff -crB Tb01 Tb02 > Tb02.patch -c context, -r recursive (multiple levels dir), -B is to ignore Blank Lines. How to patch? Doing dry-run like this: patch --dry-run -p1 -i Tb02.patch The success output looks like this: patching file TbApi.cpp patching file TbApi.h patching file TbCard.cpp ... The failure ouptut looks like this: patching file TbCard.cpp Hunk #2 FAILED at 585. 1 out of 2 hunks FAILED -- saving rejects to file TbCard.cpp.rej patching file TbCard.h Hunk #1 FAILED at 57. At last, if the dry-run is giving good result, do this and enjoy the compilation. patch -p1 -i Tb02.patch References: 1.

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. A Story When I first started using Git, I read plenty of tutorials, as well as the user manual. 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

nco sourceforge This file documents NCO, a collection of utilities to manipulate and analyze netCDF files. Copyright © 1995–2014 Charlie Zender This is the first edition of the NCO User Guide, and is consistent with version 2 of texinfo.tex. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. The license is available online at The original author of this software, Charlie Zender, wants to improve it with the help of your suggestions, improvements, bug-reports, and patches. Table of Contents The netCDF Operators, or NCO, are a suite of programs known as operators. This documentation is for NCO version 4.4.3. Enjoy, Charlie Zender Foreword NCO is the result of software needs that arose while I worked on projects funded by NCAR, NASA, and ARM. Summary

Git from the bottom up In my pursuit to understand Git, it’s been helpful for me to understand it from the bottom up — rather than look at it only in terms of its high-level commands. And since Git is so beautifully simple when viewed this way, I thought others might be interested to read what I’ve found, and perhaps avoid the pain I went through finding it. The following article offers what I’ve learned on this journey so far. I hope it can help others to comprehend this wonderful system, and discover some of the joy I’ve experienced in the past few weeks. NOTE: After receiving more than fifty corrections by e-mail from very helpful readers, I’ve updated the PDF to reflect their input. The date at the front should read “December 2009″ if you have the latest version. Here is a summary from the table of contents:

training (The GitHub Training Team) Creation d un fichier netcdf en fortran 1.1 Creating a NetCDF Dataset Here is a typical sequence of netCDF calls used to create a new netCDF dataset: NF90_CREATE ! create netCDF dataset: enter define mode ... NF90_DEF_DIM ! define dimensions: from name and length ... Only one call is needed to create a netCDF dataset, at which point you will be in the first of two netCDF modes. One call to NF90_DEF_DIM is needed for each dimension created. Once in data mode, you can add new data to variables, change old values, and change values of existing attributes (so long as the attribute changes do not require more storage space). Finally, you should explicitly close all netCDF datasets that have been opened for writing by calling NF90_CLOSE.

TracStandalone Note: this page documents the version 1.0 of Trac, see 0.12/TracStandalone if you need the previous version Tracd is a lightweight standalone Trac web server. It can be used in a variety of situations, from a test or development server to a multiprocess setup behind another web server used as a load balancer. Pros ¶ Fewer dependencies: You don't need to install apache or any other web-server. Cons ¶ Fewer features: Tracd implements a very simple web-server and is not as configurable or as scalable as Apache httpd. Usage examples ¶ A single project on port 8080. $ tracd -p 8080 /path/to/project Strictly speaking this will make your Trac accessible to everybody from your network rather than localhost only. $ tracd --hostname=localhost -p 8080 /path/to/project With more than one project. $ tracd -p 8080 /path/to/project1 /path/to/project2 You can't have the last portion of the path identical between the projects since Trac uses that name to keep the URLs of the different projects unique. where: