1. Learn Git
    1. Learn Git with Bitbucket Cloud
      1. Create a Git repository
      2. Copy your Git repository and add files
      3. Pull changes from your Git repository on Bitbucket Cloud
      4. Use a Git branch to merge a file
    2. Learn about code review in Bitbucket Cloud
      1. Fork a teammate's repository
      2. Copy your fork and make a change to the repository
      3. Create a pull request
  2. Getting Started
    1. What is version control
      1. Benefits of version control
    2. What is Git
      1. Performance
      2. Security
      3. Flexibility
      4. Version control with Git
    3. Why Git for your organization
      1. Git for developers
      2. Git for marketing
      3. Git for product management
      4. Git for designers
      5. Git for customer support
      6. Git for human resources
      7. Git for anyone managing a budget
    4. Install Git
      1. Install Git on Mac OS X
      2. Install Git on Windows
      3. Install Git on Linux
    5. Setting up a repository
      1. git init
      2. git clone
      3. git config
    6. Saving changes
      1. git add
      2. git commit
    7. Git Stash
      1. .gitignore
        1. Inspecting a repository
          1. git status
          2. git log
        2. Viewing old commits
          1. Undoing Changes
            1. git checkout
            2. git revert
            3. git reset
            4. git clean
          2. Rewriting history
            1. git commit --amend
            2. git rebase
            3. git rebase -i
            4. git reflog
        3. Collaborating
          1. Syncing
            1. git remote
            2. git fetch
            3. git pull
            4. git push
          2. Making a Pull Request
            1. How it works
            2. Example
            3. Where to go from here
          3. Using Branches
            1. git branch
            2. git checkout
            3. git merge
          4. Comparing Workflows
            1. Centralized Workflow
            2. Feature Branch Workflow
            3. Gitflow Workflow
            4. Forking Workflow
        4. Migrating to Git
          1. SVN to Git - prepping for the migration
            1. For administrators
            2. Basic Git commands
            3. Git Migration Tools
            4. For developers
          2. Migrate to Git from SVN
            1. Prepare
              1. Convert
                1. Synchronize
                  1. Share
                    1. Migrate
                      1. Perforce to Git - why to make the move
                        1. Migrating from Perforce to Git
                        2. Advanced Tips
                          1. Advanced Git Tutorials
                            1. Merging vs. Rebasing
                              1. Conceptual Overview
                              2. The Golden Rule of Rebasing
                              3. Workflow Walkthrough
                              4. Summary
                            2. Reset, Checkout, and Revert
                              1. Commit-level Operation
                              2. File-level Operations
                              3. Summary
                            3. Advanced Git log
                              1. Formatting Log Output
                              2. Filtering the Commit History
                              3. Summary
                            4. Git Hooks
                              1. Conceptual Overview
                              2. Local Hooks
                              3. Server-side Hooks
                              4. Summary
                            5. Refs and the Reflog
                              1. Hashes
                              2. Refs
                              3. Packed Refs
                              4. Special Refs
                              5. Refspecs
                              6. Relative Refs
                              7. The Reflog
                              8. Summary
                            6. Git LFS


                            The first step to migrating a project from SVN to Git-based version control is to prepare the migration lead’s local machine. In this phase, you’ll download a convenient utility script, mount a case-sensitive filesystem (if necessary), and map author information from SVN to Git.

                            All of the the following steps should be performed on the migration lead’s local machine.

                            Download the migration script

                            Git comes with most of the necessary tools for importing an SVN repository; however, there are a few missing bits of functionality that Atlassian has rolled into a handy JAR file. This file will be integral to the migration, so be sure to download svn-migration-scripts.jar from Atlassian’s Bitbucket account. This guide assumes that you’ve saved it in your home directory.

                            Once you’ve downloaded it, it’s a good idea to verify the scripts to make sure you have the Java Runtime Environment, Git, Subversion, and the git-svn utility installed. Open a command prompt and run the following:

                            java -jar ~/svn-migration-scripts.jar verify

                            This will display an error message in the console if you don’t have the necessary programs for the migration process. Make sure that any missing software is installed before moving on.

                            If you get a warning about being unable to determine a version, run export LANG=C (*nix) or SET LANG=C (Windows) and try again.

                            If you’re performing the migration on a computer running OS X, you’ll also see the following warning:

                            You appear to be running on a case-insensitive file-system. This is unsupported, and can result in data loss.

                            We’ll address this in the next section.

                            Mount a case-sensitive disk image

                            Migrating to Git should be done on a case-sensitive file system to avoid corrupting the repository. This is a problem if you’re performing the migration on an OS X computer, as the OS X filesystem isn’t case-sensitive.

                            If you’re not running OS X, all you need to do is create a directory on your local machine called ~/GitMigration. This is where you will perform the conversion. After that, you can skip to the next section.

                            Git migration: mount disk image

                            If you are running OS X, you need to mount a case-sensitive disk image with the create-disk-image script included in svn-migration-scripts.jar. It takes two parameters:

                            1. The size of the disk image to create in gigabytes. You can use any size you like, as long as it’s bigger than the SVN repository that you’re trying to migrate.
                            2. The name of the disk image. This guide uses GitMigration for this value.

                            For example, the following command creates a 5GB disk image called GitMigration:

                            java -jar ~/svn-migration-scripts.jar create-disk-image 5 GitMigration

                            The disk image is mounted in your home directory, so you should now see a directory called ~/GitMigration on your local machine. This serves as a virtual case-sensitive filesystem, and it’s where you’ll store the converted Git repository.

                            Extract the author information

                            SVN only records the username of the author for each revision. Git, however, stores the full name and email address of the author. This means that you need to create a text file that maps SVN usernames to their Git counterparts.

                            Git migration: Map SVN usernames to Git usernames

                            Run the following commands to automatically generate this text file:

                            cd ~/GitMigration 
                            java -jar ~/svn-migration-scripts.jar authors <svn-repo> > authors.txt

                            Be sure to replace <svn-repo> with the URI of the SVN repository that you want to migrate. For example, if your repository resided at https://svn.example.com, you would run the following:

                            java -jar ~/svn-migration-scripts.jar authors https://svn.example.com > authors.txt

                            This creates a text file called authors.txt that contains the username of every author in the SVN repository along with a generated name and email address. It should look something like this:

                            j.doe = j.doe <j.doe@mycompany.com> 
                             m.smith = m.smith <m.smith@mycompany.com>

                            Change the portion to the right of the equal sign to the full name and email address of the corresponding user. For example, you might change the above authors to:

                            j.doe = John Doe <john.doe@atlassian.com>
                             m.smith = Mary Smith <mary.smith@atlassian.com>


                            Now that you have your migration scripts, disk image (OS X only), and author information, you’re ready to import your SVN history into a new Git repository. The next phase explains how this conversion works.