background preloader

Nick Farina - Git Is Simpler Than You Think

Nick Farina - Git Is Simpler Than You Think
It was about one year ago that we switched to Git. 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 Git is not a Prius. By now we all know how to drive Git. Did you know the top result for “git tutorial” is this manpage on kernel.org? So instead let’s pull over, open the hood up, and poke around. The Basics We’ll run through some basic commands to make a repository for our examples: Now we have a git repository with one file and one commit, that is to say, one “version”. ~/mysite$ echo "<center>Cats are cute. With me so far? The Repository User Interface

A Git Primer git is a wicked-powerful distributed revision control system. It is confusing to many, so there are myriad tutorials and explanations online to help people understand it. This one will focus on the fundamental concepts and tasks rather than trying to compete with the documentation. “I’m an egotistical bastard, and I name all my projects after myself. Definitions Working Directory - the working directory is the directory where you have content that you want to manage with git. Commit - a commit is a full snapshot of the contents of your working directory (everything being tracked by git, anyway), and it’s kept track of using a unique 40 character SHA1 hash. Index - the index can be considered a staging area. Branch - a branch is similar in concept to other versioning systems, but in git it’s simply a pointer to a particular commit. Understanding how these components work together is the key to understanding git. git‘s Index $ git status On branch master Branches $ git checkout Remote Repositories

Git Book - Basic Branching and Merging Let’s go through a simple example of branching and merging with a workflow that you might use in the real world. You’ll follow these steps: Do work on a web site. At this stage, you’ll receive a call that another issue is critical and you need a hotfix. Revert back to your production branch. Basic Branching First, let’s say you’re working on your project and have a couple of commits already (see Figure 3-10). Figure 3-10. You’ve decided that you’re going to work on issue #53 in whatever issue-tracking system your company uses. $ git checkout -b iss53 Switched to a new branch "iss53" This is shorthand for: $ git branch iss53 $ git checkout iss53 Figure 3-11 illustrates the result. Figure 3-11. You work on your web site and do some commits. $ vim index.html $ git commit -a -m 'added a new footer [issue 53]' Figure 3-12. Now you get the call that there is an issue with the web site, and you need to fix it immediately. $ git checkout master Switched to branch "master" Figure 3-14. Figure 3-15.

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. 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 update & merge tagging log useful hints guides

How to Setup SSH Keys on a Linux System - Freedom Penguin On September 9th, 2015 Chris L. asked… Hello Matt and the Freedom Penguin staff! I have a question about generating RSA public and private keys under Linux. Hi Chris! Allow me to let you in on a little secret – I have never used PuTTY or PuTTYGen. First, allow me to acknowledge that most documentation is convoluted. On the client side, Ubuntu comes with the SSH client already installed. The steps we’re going to be taking break down as follows: 1) Generate a key on your local machine. 2) Install OpenSSH Server on remote machine. 3) Send the key to your remote machine. 4) Lockdown the remote machine by removing the password authentication. Step #1 – From your local machine, you need to create RSA keys. On your local machine, in a terminal: mkdir ~/.ssh If it already exists that’s great, let’s make sure the permissions are correct. chmod 700 ~/.ssh chmod 700 ~/.ssh cd ~/.ssh Now let’s create our keys. ssh-keygen -t rsa ssh-keygen -t rsa This will kick out the following cryptic tidbit: Ubuntu 15.04+

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

Why You Should Switch from Subversion to Git You may have heard some hubbub over distributed version control systems recently. You may dismiss it as the next hot thing, the newest flavor of kool-aid currently quenching the collective thirst of the bandwagon jumpers. You, however, have been using Subversion quite happily for some time now. It has treated you pretty well, you know it just fine and you are comfortable with it – I mean, it’s just version control, right? You may want to give it a second look. Not just at distributed version control systems, but at the real role of version control in your creative toolkit. Now, this isn’t really a how-to on Git – I won’t be going over a lot of specific commands or get you up and running. The Advantages of Being Distributed Git is a distributed version control system. Now, this gives you a couple of immediate advantages. The other implicit advantage of this model is that your workflow does not have a single point of failure. Lightweight Branches: Frictionless Context Switching In Closing…

index • Git Cheatsheet • NDP Software stash workspace index local repository upstream repository status Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the workspace and the index file, and paths in the workspace that are not tracked by git. diff Displays the differences not added to the index. diff commit or branch View the changes you have in your workspace relative to the named <em>commit</em>. add file... or dir... Adds the current content of new or modified files to the index, thus staging that content for inclusion in the next commit. add -u Adds the current content of modified (NOT NEW) files to the index. rm file(s)... Remove a file from the workspace and the index. mv file(s)... Move file in the workspace and the index. commit -a -m 'msg' Commit all files changed since your last commit, except untracked files (ie. all files that are already listed in the index). checkout files(s)... or dir Updates the file or directory in the workspace. reset --soft HEAD^

Install Snap packages in Arch Linux, and Fedora - OSTechNix In our previous tutorial, we have discussed what is Snap packages, its advantages and disadvantages, where you can get the Snap packages, and how to create your own Snap packages etc. For more details, check our previous article. An introduction to Ubuntu’s Snap packages Today, we will see how to install Snap packages and use them in real time. As you may already know, Snapd, which is used to install Snap packages, comes preinstalled by default in Ubuntu 16.04 LTS. So, we don’t have to install it in Ubuntu 16.04 Desktop or Server. Install Snapd in Arch Linux Snapd is not available in the Arch Linux’s official repositories. To install yaourt, refer the following link: How to install Yaourt on Arch Linux To install packer, check the following link: How to install Packer on Arch Linux After installing yaourt or packer, run the following command to install Snapd: yaourt -S snapd Or packer -S snapd Sample output: Install Snapd Edit snapd PKGBUILD with $EDITOR? sudo systemctl start snapd.socket dnf update

GitHub Firewall Install Git - SVN Crash Course Welcome to the Git version control system! Here we will briefly introduce you to Git usage based on your current Subversion knowledge. You will need the latest Git installed; There is also a potentially useful tutorial in the Git documentation. This page is not maintained anymore! The up-to-date version of this tutorial is the GitSvnCrashCourse page at the Git wiki. How to Read Me In those small tables, at the left we always list the Git commands for the task, while at the right the corresponding Subversion commands you would use for the job are listed. Before running any command the first time, it's recommended that you at least quickly skim through its manual page. Things You Should Know There are couple important concepts it is good to know when starting with Git. Repositories. Commiting For the first introduction, let's make your project tracked by Git and see how we get around to do daily development in it. Now your tree is officially tracked by Git. That's it. Browsing Merging

gitglossary(7) alternate object database Via the alternates mechanism, a repository can inherit part of its object database from another object database, which is called "alternate". bare repository A bare repository is normally an appropriately named directory with a .git suffix that does not have a locally checked-out copy of any of the files under revision control. That is, all of the git administrative and control files that would normally be present in the hidden .git sub-directory are directly present in the repository.git directory instead, and no other files are present and checked out. blob object Untyped object, e.g. the contents of a file. branch A "branch" is an active line of development. cache Obsolete for: index. chain A list of objects, where each object in the list contains a reference to its successor (for example, the successor of a commit could be one of its parents). changeset BitKeeper/cvsps speak for "commit". checkout cherry-picking clean commit commit object core git Directed acyclic graph.

Fred's ImageMagick Scripts Licensing: Copyright © Fred Weinhaus My scripts are available free of charge for non-commercial use, ONLY. For use of my scripts in commercial (for-profit) environments or non-free applications, please contact me (Fred Weinhaus) for licensing arrangements. If you: 1) redistribute, 2) incorporate any of these scripts into other free applications or 3) reprogram them in another scripting language, then you must contact me for permission, especially if the result might be used in a commercial or for-profit environment. Usage, whether stated or not in the script, is restricted to the above licensing arrangements. Technical Jargon Last month I posted about hosting a git server under IIS by using GitAspx. While this is certainly one way to host a git server on windows, I wouldn’t recommend this in a production environment. An alternative (and somewhat more stable) approach is to use the native implementation of git-http-backend that ships with msysgit along with Apache. Step 1: Install Git Firstly you’ll need to install msysgit. The current stable version is 1.7.0.2, but this process should also work with the 1.7.1 beta. Once installed, you’ll need to tweak the installation slightly. In order to fix this, copy libiconv2.dll from C:Program Files (x86)Gitbin to C:Program Files (x86)Gitlibexecgit-core Now when you run git-http-backend.exe from a command prompt, the application should run and you should see an HTTP 500 server error: Step 2: Install Apache Next you’ll need to install the Apache webserver. If you visit at this point you should be greeted with Apache’s standard “It works!”

Related: