background preloader

Git howto

Facebook Twitter

5 GitHub tips for new coders. This October I celebrated my 5 year anniversary working at GitHub. 🎉 5 years ago, I was an enthusiastic accountant (like straight nerd — my former twitter handle was @taxaly) who knew nothing about code, let alone about using Git and GitHub. Now I’m an enthusiastic Data Scientist who knows a handful of things about coding using Git & GitHub. It’s partially thanks to learning these technologies that I made this rewarding career switch. But even working at GitHub, learning Git and GitHub were hard! As it’s own form of an open source contribution, I wanted to share with other folks new to coding my top 5 tips for using GitHub. Tip #1: Change your default text editor associated with Git For many people, the default text editor when using Git from the terminal is VIM.

If you ever find yourself with a merge conflict (and you will, see tip #4), you’ll get kicked out to VIM to fix the conflict and then you’ll need to know the specific VIM commands to edit the doc and want to cry. Ask a Swiss: 12 advanced Git commands I wish my co-workers would know. © xkcd Once you have internalized the basic work flow, Git is a powerful tool for distributed version control that offers a lot of advantages over more clunky alternatives like SVN.

Ask a Swiss: 12 advanced Git commands I wish my co-workers would know

You clone, you pull, you commit, you push; nothing simpler than that. Git for Computer Scientists. Abstract Quick introduction to git internals for people who are not scared by words like Directed Acyclic Graph.

Git for Computer Scientists

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. Understanding Git: Repositories. In This Section.

Understanding Git: Repositories

Git (software) Git (/ɡɪt/[6]) is a version control system (VCS) that is used for software development[7] and other version control tasks.

Git (software)

As a distributed revision control system it is aimed at speed,[8] data integrity,[9] and support for distributed, non-linear workflows.[10] Git was created by Linus Torvalds in 2005 for development of the Linux kernel, with other kernel developers contributing to its initial development.[11] Its current maintainer is Junio Hamano. Like the Linux kernel, Git is free software distributed under the terms of the GNU General Public License version 2. History[edit] Git development began in April 2005, after many developers of the Linux kernel gave up access to BitKeeper, a proprietary source control management (SCM) system that they had formerly used to maintain the project.[13] The copyright holder of BitKeeper, Larry McVoy, had withdrawn free use of the product after claiming that Andrew Tridgell had reverse-engineered the BitKeeper protocols.[14]

Cygwin-apps - [ITP] VOTE: oodiff and git-oodiff. Matthieu Moy has written two very useful programs to take diffs between two Open Office documents.

cygwin-apps - [ITP] VOTE: oodiff and git-oodiff

Please vote to make them included in Cygwin. For more information, visit: Jari sdesc: "Diff program for OpenDocument files" ldesc: "A diff program to make it possible to diff OpenDocument (OpenOffice, Koffice ...) documents. Git. Git is an open source, distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Git

Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do. Before starting, make sure that: * You already have a Ubuntu 9.04 or Ubuntu 10.04 (or a newer version) installed on you computer/server. * You already have a public ssh key on your local machine you can use that to initialize the repository.

. * You have customised an editor by setting the environment variable EDITOR to your favourite editor. Git - Fast Version Control System. Why aren't you using git-flow? If you need tagged and versioned releases, you can use git-flow’s release branches to start a new branch when you’re ready to deploy a new version to production.

Why aren't you using git-flow?

Like everything else in git-flow, you don’t have to use release branches if you don’t want to. Prefer to manually git merge --no-ff develop into master without tagging? No problem. However, if you’re working on a versioned API or library, release branches might be really useful, and they work exactly like you’d expect: $ git flow release start 0.1.0 Switched to a new branch 'release/0.1.0' Summary of actions: - A new branch 'release/0.1.0' was created, based on 'develop' - You are now on branch 'release/0.1.0' Follow-up actions: - Bump the version number now! Bump the version number and do everything that’s required to release your project in the release branch. Learn git one commit at a time.

Learn git one commit at a time. Nick Farina - Git Is Simpler Than You Think. It was about one year ago that we switched to Git.

Nick Farina - Git Is Simpler Than You Think

Previously, we used Subversion, through the Mac app Versions, which (rightly) holds an Apple Design Award. I made the executive decision to leave our comfy world of Versions because it seemed clear that Git was winning the Internet. There was much grumbling from my teammates, who were busy enough doing actual work thank you very much. But I pressed forward. We signed up for accounts on Github. It might as well have printed PC LOAD LETTER. “Not currently on any branch?!” Maintenance Required. A successful Git branching model » nvie.com.

Note of reflection (March 5, 2020)This model was conceived in 2010, now more than 10 years ago, and not very long after Git itself came into being.

A successful Git branching model » nvie.com

In those 10 years, git-flow (the branching model laid out in this article) has become hugely popular in many a software team to the point where people have started treating it like a standard of sorts — but unfortunately also as a dogma or panacea.During those 10 years, Git itself has taken the world by a storm, and the most popular type of software that is being developed with Git is shifting more towards web apps — at least in my filter bubble. Web apps are typically continuously delivered, not rolled back, and you don't have to support multiple versions of the software running in the wild.This is not the class of software that I had in mind when I wrote the blog post 10 years ago.

What a Branch Is. To really understand the way Git does branching, we need to take a step back and examine how Git stores its data.

What a Branch Is

As you may remember from Chapter 1, Git doesn’t store data as a series of changesets or deltas, but instead as a series of snapshots. When you commit in Git, Git stores a commit object that contains a pointer to the snapshot of the content you staged, the author and message metadata, and zero or more pointers to the commit or commits that were the direct parents of this commit: zero parents for the first commit, one parent for a normal commit, and multiple parents for a commit that results from a merge of two or more branches. To visualize this, let’s assume that you have a directory containing three files, and you stage them all and commit. Staging the files checksums each one (the SHA-1 hash we mentioned in Chapter 1), stores that version of the file in the Git repository (Git refers to them as blobs), and adds that checksum to the staging area:

Free Mercurial and Git Client for Windows and Mac. How to Git Open Atrium. UPDATE: "Open Atrium has moved from its single monolitic repository to an install profile and a drush make based build system. This is a change that primarily effects developers. The complete, ready to install, download will continue to be offered at Details here. Thanks, Jeff. I've been playing around with the Open Atrium project (Features rule!) , which is a very cool Drupal-based intranet distribution created by those smarty-pants over at Development Seed. I went to download the latest version, but noticed that (as of December 31) it hadn't been updated with the latest version of Drupal core.

It turns out that the project repository is hosted at GitHub. Ignoring files. Committed 19 Jan 2009 We don’t need Git to version everything in our projects, be it compiled source, files with passwords, or temporary files that editors love to create. Usually keeping stuff out of your VCS’ hands is a task that is hard to manage and annoying to set up. Not with Git! Using the .gitignore file along with some other options, we’re going to learn how to set up per-project and per-user ignores. The easiest and simplest way is to create a .gitignore file in your project’s root directory. Here’s a basic .gitignore: $ cat .gitignore # Can ignore specific files .DS_Store # Use wildcards as well *~ *.swp # Can also ignore all directories and files in a directory. tmp/**/* Of course, this could get a lot more complex.

GIT: Using the stash. I bet the following has happened to you: you are happily working on a project and are in the middle of something. You are not ready to commit your changes, because you your tests don’t pass yet. Then your client calls with a bug report that needs to be fixed right now. (You know how clients can be.) So, what do you do? Throw away your current changes to make the patch? Git features The Stash, which is as much as a good place to store uncommitted changes. When you restore your stash, you changes are reapplied and you continue working on your code. Git Workflows. Why use git? Git is an extremely powerful source control system. Its power lies in its speed and flexibility, but this can also be a point of confusion for many new users. Git is unfortunately quite inconsistent in its syntax, and exposes many of its not-so-friendly internals to the outside world, sometimes to the detriment of usability.

As many systems built by hardcore engineers (Git came from Linux kernel hackers), if wielded by a wizard, it can be used to achieve many great things, but can be initially confusing even for seasoned developers. Git Immersion - Brought to you by EdgeCase. Everyday GIT With 20 Commands Or So. A standalone individual developer does not exchange patches with other people, and works alone in a single repository, using the following commands.

Conversational Git: The Friendly Introduction to Git. This post is an excerpt from my new book, Conversational Git. The entire book is available online and its source is on GitHub. Learn git one commit at a time. Git Tutorials and Training. Git Submodules: Adding, Using, Removing, Updating. Git for the lazy - Spheriki. From Spheriki. Git: Interactively Stage Portions of a Single Changed File for Commit Using git add -p. Git repository with Apache (via WebDAV) and gitweb « Aquì estamos! Set Up a Git Server through SSH Connection - Fclose.com. The Perfect Work-flow with Git, GitHub, and SSH. Git: Your New Best Friend [Server Side Essentials] Introduction. A successful Git branching model » nvie.com. MvcContrib: Howto use git & github. User contributions for the ASP.NET MVC Framework.