Skip to content

Latest commit

 

History

History
117 lines (83 loc) · 5.35 KB

NOTES.md

File metadata and controls

117 lines (83 loc) · 5.35 KB

GIT

I'm not comfortable with git. Where can I learn it?

There are numerous tutorials to learn git. Keep in mind that the workflow at COMPANY may differ from the ones in the tutorial when it comes to posting the changes for review, git-svn, etc...

Using GIT frontend with an SVN backend

  1. Install git by following instructions on https://git-scm.com/

  2. Ensure git svn is installed.

  3. Open a terminal and change directories to where you want to store the repository

  4. Type the following:

    git svn clone --stdlayout --prefix=origin/ <SVN_REPO_ROOT_URL>

    NOTE: Depending on the size of the SVN repo, this command may take a few hours to complete as it's looking at each SVN commit and creating a respective git commit. If you don't want all the SVN history, add the following command line argument prior to providing the SVN repo URL

    --revision ####

    where #### is the revision number, to the git svn clone command. If you don't care about the SVN history, use the following command:

    git svn clone --stdlayout --revision HEAD --prefix=origin/ <SVN_REPO_ROOT_URL>

  5. Now you have a git front-end with an SVN back-end. That is, a git repo representation of the SVN repo.

  6. According to this post, git treats directories as files, while SVN makes the distinction between directories and files. Thus, removing directories from git-svn may not remove the directory from the SVN repo. As a result, let's configure git-svn to automatically remove directory. Run the following:

    git config --global svn.rmdir true

Using ReviewBoard for code reviews?

If you are using ReviewBoard for code reviews, you will need to manually setup a .reviewboardrc file to use the rbt tooling to automatically post reviews. Create the following .reviewboardrc file in the git repository root

REVIEWBOARD_URL = "<REVIEWBOARD_URL"
REPOSITORY = "<SVN repo name>"
BRANCH = "master"
TRACKING_BRANCH = "remotes/origin/trunk"

where

  • REVIEWBOARD_URL is the URL (including protocol) to the reviewboard server. e.g.: http://reviewboard.compnany.com
  • REPOSITORY is the SVN repository name as it appears on reviewboard.
  • Set BRANCH to point to the target branch where the changes should be diffed against

git svn command does not exist. What do I do?

If you encounter a problem similar to

$ git svn -h
git: 'svn' is not a git command. See 'git --help'.

Did you mean this?
        fsck
        show

It means the git-svn option is not installed on your system. Search the internet for instructions on how to install it for your current OS. This stackoverflow post might be a good starting point

Resources

XPath

Slack Teams

Chrome Extensions

Useful Applications

Windows Tools

First, try the Windows Subsystem for Linux (WSL) to see if it meets the needs.

  • cmder - Portable console emulator for Windows
  • cygwin - Collection of GNU and Open Source tools which provide functionality similar to a Linux distribution on Windows
  • gnu.org - Tools for Windows