background preloader

Git

Facebook Twitter

Git concepts simplified. Pour arrêter de galérer avec Git « Développeur web freelance. J'adore Git ! Depuis 5 ans que je l'utilise quotidiennement, je ne me lasse pas d'admirer la puissance sublime de cet outil, et je ne compte plus les fois ou ma vie fut sauvée par l'une ou l'autre de ces obscures mais miraculeuses commandes. D'ailleurs, n'est-ce pas Aristote qui as dit « Donnez-moi vim et git, et je soulèverai le monde » ? Ce n'est pas un hasard si en Swahili, « Git » signifie « divinité toute puissante à la sagacité du renard, la volupté de l'hippopotame et la virilité du bonobo ». Je dois pourtant reconnaître que Git n'est pas forcément l'outil le plus abordable qui soit.

Toutes ces commandes bizarres ! C'est surtout après avoir eu l'occasion de donner une formation de 2 jours sur Git récemment que j'ai pu vraiment approfondir certains concepts, résoudre un certain nombre de « WTF ?! Tenez, prenez l'exemple suivant : Comment j'annule une modification d'un fichier ? Git checkout Ok, comment je change de branche ? Ok, et comment je créé une nouvelle branche ? Heu… Quoi ?! Git merge vs. rebase. The short: git pull --rebase instead of git pullgit rebase -i @{u} before git push(on “feature”) git merge master to make feature compatible with latest master(on “master”) git merge --no-ff feature to ship a feature However if “feature” contains only 1 commit, avoid the merge commit:(on “master”) git cherry-pick feature The long: If you enjoy this post, check out my git tips you didn’t know about! Avoid merge commits that result from git pull When you want to push your changes to a branch, but someone else already pushed before you, you have to pull in their changes first.

Such merge commits can be numerous, especially between a team of people who push their changes often. You should always pull with git pull --rebase. Git config --global --bool pull.rebase true Interactively rebase local commits before pushing Run this every time before pushing a set of commits: git rebase -i @{u} Suppose you have a set of 4 commits (newest first): [D] oops! Git merge --no-ff feature git cherry-pick feature. Mémento Git à 100% - - De Raphaël Hertzog et Pierre Habouzit (EAN13 : 9782212181111) La collection mémento enfin en version numérique !

Utilisé depuis plus de 5 ans pour le noyau Linux, Git est le système révolutionnaire de gestion de versions, plébiscité chez les développeurs modernes. Co-écrit par deux développeurs Git et Debian, ce mémento aidera les développeurs qui découvrent la gestion de versions avec Git à optimiser leurs processus d'édition collaborative et à exploiter sans risque la puissance de cet outil, qui succède à CVS et SVN.

Le développeur verra rappelées toutes les commandes de création, d'exploration, de modification, d'annulation et de restauration de code ou de branche, avec un schéma illustrant les commandes liées aux cinq grands lieux de Git : le cache (stash), le répertoire de travail, l'index, le dépôt local et le dépôt distant. Les auteurs complètent le mémento de nombreux conseils d'utilisation - ce qu'est un bon commit, comment l'écrire... GITLAB Site. Book. Soirée Git - prez @sdouche.

Git Cheatsheet. How to export revision history from mercurial or git to cvs. 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. 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.

Why git? ¶ For a thorough discussion on the pros and cons of Git compared to centralized source code control systems, see the web. The main branches ¶ develop. Generating SSH keys (Linux) 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!

You can use it without ever touching the command line. 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. Step 2: Generate a new SSH key. Git - Problems with pushing to github repository from Eclipse: Auth fail.

HTTPS push authentication failed / Repo issues / Discussion Area - GitHub Support. Everyday GIT With 20 Commands Or So. EGit/Git For Eclipse Users. This post is aimed at those who have been using Eclipse for a while, and probably have been using either the baked-in CVS or external SVN providers to store their source code. The content of the post is about Git: what it means to you, as an Eclipse user, and specifically, how it affects how you obtain or work with projects from Eclipse.org.

This post is not about the relative merits of Git over CVS/SVN, or of Git versus other distributed version control systems (DVCS) like Mercurial (Hg). Other sites can give those flavours if needed. Once you understand the conceptual differences between CVS/SVN and Git, and then subsequently start to use Git, you may find it very difficult to go back. You should really start to experiment only if you think you're going to migrate in the near future, because using Git is like watching TV in colour: once you've discovered it, it's really difficult to go back to black & white. ☞ Once you start to use a DVCS, it's very unlikely you'll want to go back.

EGit/User Guide. Overview If you're new to Git or distributed version control systems generally, then you might want to read Git for Eclipse Users first. More background and details can be found in the on-line book Pro Git. If you are coming from CVS, you can find common CVS workflows for Git Platform-releng/Git Workflows.

Basic Tutorial: Adding a project to version control Configuration Identifying yourself Whenever the history of the repository is changed (technically, whenever a commit is created), Git keeps track of the user who created that commit. EGit will ask you for this information when you create your first commit. You can also untick "Don't show this dialog again" if you want to see it again later. Instead of using this dialog, you can always change this information using the Git configuration: Click Preferences > Team > Git > ConfigurationClick New Entry and enter the key value pairs user.email and user.name Setting up the Home Directory on Windows Pointing out the System wide configuration /bin Trust.