background preloader

GitHub Training

GitHub Training

git - the simple guide - no deep shit! git - the simple guide just a simple guide for getting started with git. no deep shit ;) by Roger Dudler credits to @tfnico, @fhd and Namics this guide in deutsch, español, français, indonesian, italiano, nederlands, polski, português, русский, türkçe, မြန်မာ, 日本語, 中文, 한국어 Vietnamese please report issues on github Infuse analytics everywhere with the AI-powered embedded analytics platform. Start your free trial.ads via Carbon setup Download git for OSX Download git for Windows Download git for Linux create a new repository create a new directory, open it and perform a git init to create a new git repository. checkout a repository create a working copy of a local repository by running the command git clone /path/to/repository when using a remote server, your command will be git clone username@host:/path/to/repository workflow add & commit You can propose changes (add it to the Index) using git add <filename> git add * This is the first step in the basic git workflow. pushing changes branching log

Git Hooks Like many other Version Control Systems, Git has a way to fire off custom scripts when certain important actions occur. There are two groups of these hooks: client side and server side. The client-side hooks are for client operations such as committing and merging. The server-side hooks are for Git server operations such as receiving pushed commits. Installing a Hook The hooks are all stored in the hooks subdirectory of the Git directory. To enable a hook script, put a file in the hooks subdirectory of your Git directory that is named appropriately and is executable. Client-Side Hooks There are a lot of client-side hooks. Committing-Workflow Hooks The first four hooks have to do with the committing process. The prepare-commit-msg hook is run before the commit message editor is fired up but after the default message is created. The commit-msg hook takes one parameter, which again is the path to a temporary file that contains the current commit message. E-mail Workflow Hooks update

Generating SSH Keys SSH keys are a way to identify trusted computers, without involving passwords. The steps below will walk you through generating an SSH key and adding the public key to your GitHub account. We recommend that you regularly review your SSH keys list and revoke any that haven't been used in a while. Tip: GitHub has a desktop client! Tip: If you have GitHub for Windows installed, you can use it to clone repositories and not deal with SSH keys. Step 1: Check for SSH keys First, we need to check for existing SSH keys on your computer. ls -al ~/.ssh# Lists the files in your .ssh directory, if they exist Check the directory listing to see if you already have a public SSH key. id_dsa.pubid_ecdsa.pubid_ed25519.pubid_rsa.pub If you see an existing public and private key pair listed (for example id_rsa.pub and id_rsa) that you would like to use to connect to GitHub, you can skip Step 2 and go straight to Step 3. Tip: If you receive an error that ~/.ssh doesn't exist, don't worry!

A few git tips you didn't know about Notice: some of these commands or flags require git version 1.7.2. On OS X, upgrade easily with Homebrew: brew install git Show branches, tags in git log $ git log --oneline --decorate 7466000 (HEAD, mislav/master, mislav) fix test that fails if current dir is not "hub" 494a414 fix cherry-pick of a commit URL 4277848 (origin/master, origin/HEAD, master) whoops d270fae bugfix: git init -g 9307af3 test deps 8ccc17e 64bb19c bugfix: variable name 546726a dont need you 3a8d7af (tag: v1.3.1) v1.3.1 197f429 (tag: v1.3.0) v1.3.0 a1e1a50 not important 3c6af16 magic `cherry-pick` supports GitHub commit URLs and "user@sha" notation Diff by highlighting inline word changes instead of whole lines $ git diff --word-diff # Returns a Boolean. def command? This flag works with other git commands that take diff flags such as git log -p and git show. Short status output $ git status -sb M ext/fsevent/fsevent_watch.c ?? Push a branch and automatically set tracking

Set Up Git 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*. *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? Code blocks like those on this page are part of a scripting language called Bash. was installed with Git called Git Bash. Input Email

Git tips from the trenches After a few years with git everyone has their own bag o’ tricks - a collection of bash aliases, one liners and habits that make his daily work easier. I’ve gathered a handful of these with varying complexity hoping that it can give a boost to you. I will not cover git or VCS basics at all, I’m assuming you’re already a git-addict. So fire up your favorite text editor and bear with me. Check which branches are merged After a while if you branch a lot you’ll se your git branch -a output is polluted like hell (if you havent’t cleaned up). $ git checkout master $ git branch --merged to see all the branches that have already been merged to the current branch (master in this case). You can do the opposite of course: How about deleting those obsolete branches right away? $ git branch --merged | xargs git branch -d Alternative: use GitHub’s Pull request UI if you’ve been a good sport and always used pull requests. Find something in your entire git history Local cherry-picking. Making typos? #! reflog

[Tutorial] Git desde Cero ~ Xenode Systems Blog Cuando se es programador, una de las herramientas que se convierten en nuestras mejores amigas es Git. Se trata de un sistema de control de versiones creado por nada más y nada menos que Linus Torvalds, el creador del Kernel Linux y es la mejor manera de evitar catástrofes en nuestro código además de ser un excelente gestor del trabajo cuando se trabaja en equipo. Git principalmente se usa para código, incluso hay lugares en la web (Como BitBucket y GitHub) que se dedican a crearnos un frontend para la gestión de nuestro código controlado por Git; Sin embargo, no veo razón alguna por la cual Git no pueda ser usado por otras personas para otros ámbitos (diseño, arquitectura, qué se yo) en proyectos que requieran trabajar con más de una versión de un archivo y varias modificaciones. Dicho esto, aprendamos Git pues: 1) Instalando Git Para instalar Git en Ubuntu Linux por ejemplo, haríamos lo siguiente en Terminal: sudo apt-get install git git-core 2) ¿Primera vez? 3) Editor predeterminado

Bien utiliser Git merge et rebase • Git Attitude : formations Git qualitatives et sympathiques Un git merge ne devrait être utilisé que pour la récupération fonctionnelle, intégrale et finale d’une branche dans une autre, afin de préserver un graphe d’historique sémantiquement cohérent et utile, lequel représente une véritable valeur ajoutée. Tous les autres cas de figure relèvent du rebase sous toutes ses formes : classique, tri-partite, interactif ou cherry picking. Dans cet article de fond, nous allons explorer en détail les sémantiques de merge et rebase, apprendre à choisir entre l’un ou l’autre, et donner des clés pour les utiliser au mieux afin d’obtenir un historique impeccable. Mise à jour : la version anglaise de cet article est ici Un historique propre, compréhensible et utile Une des compétences les plus importantes d’un utilisateur de Git réside dans la capacité à garder un historique public de commits qui soit propre et sémantique. Pourtant, ces deux commandes n’ont pratiquement rien à voir. Dans quels cas utiliser merge ? Dans quels cas utiliser rebase ? Et voilà !

tortoisesvn.tigris.org Git Attitude : formations Git qualitatives et sympathiques

Related: