This guide will demonstrate how to mirror an SVN into a Git repo. You're the target audience if you're an SVN user, just getting started with Git and need to coax your project team over to Git.
The branching scenario has been simplified for clarity.
| // See comments below. | |
| // This code sample and justification brought to you by | |
| // Isaac Z. Schlueter, aka isaacs | |
| // standard style | |
| var a = "ape", | |
| b = "bat", | |
| c = "cat", | |
| d = "dog", |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| (function($) { | |
| // Used by dateinput | |
| $.expr = {':': {}}; | |
| // Used by bootstrap | |
| $.support = {}; | |
| // Used by dateinput | |
| $.fn.clone = function(){ | |
| var ret = $(); |
| /* | |
| You can use this to convert a DOM element or a HTML string to markdown. | |
| Usage examples: | |
| var markdown = toMarkdown(document.getElementById("content")); | |
| // With jQuery you can easily convert HTML strings | |
| var markdown = toMarkdown($("<ul><li>Hi!</li></ul>")[0]); |
| var user = { | |
| validateCredentials: function (username, password) { | |
| return ( | |
| (!(username += '') || username === '') ? { error: "No Username Given.", field: 'name' } | |
| : (!(username += '') || password === '') ? { error: "No Password Given.", field: 'pass' } | |
| : (username.length < 3) ? { error: "Username is less than 3 Characters.", field: 'name' } | |
| : (password.length < 4) ? { error: "Password is less than 4 Characters.", field: 'pass' } | |
| : (!/^([a-z0-9_-]+)$/i.test(username)) ? { error: "Username contains invalid characters.", field: 'name' } | |
| : false | |
| ); |
| Assuming you have created a submodule 'mysub' in repo 'myrepo' | |
| Set the sparse checkout config property in the submodule | |
| myrepo/.git/modules/mysub/config: | |
| [core] | |
| repositoryformatversion = 0 | |
| filemode = true | |
| bare = false |
| #! /bin/bash | |
| ### BEGIN INIT INFO | |
| # Provides: yourapp | |
| # Required-Start: nginx | |
| # Required-Stop: | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: The main django process | |
| # Description: The gunicorn process that receives HTTP requests | |
| # from nginx |
What are we trying to observe? Raw object data.
// Objects
var obj = { id: 2 };
obj.id = 3; // obj == { id: 3 }
// Arrays
var arr = ['foo', 'bar'];
arr.splice(1, 1, 'baz'); // arr == ['foo', 'baz'];