background preloader

Git Immersion - Brought to you by EdgeCase

Git Immersion - Brought to you by EdgeCase

lorempixum - placeholder images for every case A Visual Git Reference If the images do not work, you can try the Non-SVG version of this page. SVG images have been disabled. (Re-enable SVG) This page gives brief, visual reference for the most common commands in git. Also recommended: Visualizing Git Concepts with D3 Contents Basic Usage The four commands above copy files between the working directory, the stage (also called the index), and the history (in the form of commits). git add files copies files (at their current state) to the stage. git commit saves a snapshot of the stage as a commit. git reset -- files unstages files; that is, it copies files from the latest commit to the stage. You can use git reset -p, git checkout -p, or git add -p instead of (or in addition to) specifying particular files to interactively choose which hunks copy. It is also possible to jump over the stage and check out files directly from the history or commit files without staging first. Conventions In the rest of this document, we will use graphs of the following form. Diff Commit

Google C++ Style Guide Definition: Streams are a replacement for printf() and scanf(). Pros: With streams, you do not need to know the type of the object you are printing. You do not have problems with format strings not matching the argument list. (Though with gcc, you do not have that problem with printf either.) Cons: Streams make it difficult to do functionality like pread(). Decision: Do not use streams, except where required by a logging interface. There are various pros and cons to using streams, but in this case, as in many other cases, consistency trumps the debate. Extended Discussion There has been debate on this issue, so this explains the reasoning in greater depth. Proponents of streams have argued that streams are the obvious choice of the two, but the issue is not actually so clear. cout << this; // Prints the address cout << *this; // Prints the contents The compiler does not generate an error because << has been overloaded. And so on and so forth for any issue you might bring up.

Home mrdoob/three.js - GitHub Intro to Git for Web Designers Unless you’re a one person web shop with no team to collaborate with, you’ve experienced the frustration that goes along with file sharing. No matter how hard you try, when multiple people are working on a single project without a version control system in place things get chaotic. If you work with developers on the buildout and implementation of websites, the merge between front-end templates and back-end functionality can be a scary black hole. Issues like overwrites, lost files, and the all-too-common “working off a previous version” phenomenon crop up constantly. In addition, even if you have a common repository that everyone is pulling from odds are at least one member of your team forgot to grab the latest files and is about to blow things up with their latest additions. In this article, I’ll give you a quick review of Git, an excellent version control system. Version Control – A Quick and Dirty Explanation A good VCS also allows you to merge changes to the same file. Meet Git

Open Mikros Image Utiliser p4merge Git doesn’t come with a merge tool, but will gladly use third party tools… The Git Debate The reoccurring debate on switching from svn to git is going on again on the Ruby Core mailing list. Amoung the many objections to git is that it doesn’t come with a nice merge tool. Perforce was held up as an example of a tool that does merging right. Now You Can Have Your Cake and Eat it Too! Although it is correct that git doesn’t come with a nice merge tool, it is quite happy to use any merge tool that you have on hand. Just add the following to your .gitconfig file in your home directory: [merge] summary = true tool = "p4merge" [mergetool "p4merge"] cmd = /PATH/TO/p4merge \ "$PWD/$BASE" \ "$PWD/$LOCAL" \ "$PWD/$REMOTE" \ "$PWD/$MERGED" keepBackup = false trustExitCode = false Now, whenever git complains that a conflict must be resolved, just type: git mergetool When you are done resolving the merge conflicts, save the result from p4merge and then quit the utility. Enjoy. Update (6/Sep/09) #!

holmes.css - CSS Markup Detective What does it do? The holmes.css file will display either an error (red outline), a warning (yellow outline), or a deprecated style (dark grey outline) for flags such as: Missing required attributes on tags, such as name attributes on inputs (lots of these) Potentially improvable markup, such as links with href="#" Deprecated and Non-W3C Elements - see's article on obselete tags Non-W3C Attributes - as above, just the most important ones since there are MANY Thanks to Anthony Mann, holmes now displays an informative error message when you hover over the element. How do I use it? Simply download a version of the CSS, minified or normal (with docs), and include a stylesheet link to it on your page. In terms of configuration, such as changing the flag colours: go nuts! Why should I use it? Remember too that these are just guidelines: if something is flagged but you can't change it for a good reason, don't worry about it :) Also use a validator if you want to be 100% sure. Browser Support

Git Reference A successful Git branching model » 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