• Stars
    star
    209
  • Rank 188,325 (Top 4 %)
  • Language
  • Created over 12 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

A Git user's guide to SVN

Git to SVN :(

Some useful information can be found at svnbook.red-bean.com.

1. Create A Local Working Copy

$ svn checkout BRANCH FOLDER_NAME

1.1 Example

# Checks out repo/trunk in a folder called trunk
$ svn checkout https://code.example.com/repo/trunk

# Checks out repo/trunk in a folder called repo
$ svn checkout https://code.example.com/repo/trunk repo

1.2 Git Equivalent

$ git clone REPO

2. Create A New Branch

$ svn copy CURRENT_BRANCH NEW_BRANCH -m "MESSAGE"

2.1 Example

$ svn copy https://code.example.com/repo/trunk \
    https://code.example.com/repo/features/feature_branch \
    -m "Creating a private branch of /repo/trunk."

2.2 Git Equivalent

$ git checkout -b BRANCH

3. Switch To a Different Branch

$ svn switch BRANCH

3.1 Example

$ svn switch https://code.example.com/repo/features/feature_branch

3.2 Git Equivalent

$ git checkout BRANCH

4. Keep The Branch In Sync

$ svn update

4.1 Example

$ svn switch https://code.example.com/repo/trunk
$ svn update
$ svn switch https://code.example.com/repo/features/feature_branch
$ svn merge https://code.example.com/repo/trunk
& svn ci -m "Merge branch trunk into feature_branch"

4.2 Git Equivalent

$ git pull

5. Merge to Trunk

$ svn merge BRANCH

5.1 Example

$ svn switch https://code.example.com/repo/trunk
$ svn update
$ svn merge --reintegrate https://code.example.com/repo/features/my_feature
$ svn update
$ svn commit -m "Merge branch my_feature into trunk"

5.2 Git Equivalent

$ git merge BRANCH

6. Status

$ svn status

6.1 Git Equivalent

$ git status

7. Committing

$ svn commit -m "MESSAGE"

7.1 Example

$ svn update
$ svn status
$ svn add PATH/TO/NEW/FILES
$ svn commit -m "Added an awesome feature"

7.2 Git Equivalent

$ git commit -m "Added an awesome feature" && git push

8. Commit A Single File

$ svn commit FILE -m "MESSAGE"

8.1 Example

$ svn commit app/models/awesome.rb -m "Adding some awesome"

9. View Repository Structure

$ svn ls REPO

9.1 Example

$ svn ls https://code.example.com/repo
branches/
features/
tags/
trunk/

$ svn ls https://code.example.com/repo/features
sprint_17/
sprint_18/
sprint_19/

9.2 Git Equivalent

$ git branch -a

10. View Repository Details

$ svn info

11. Revert Changes

 $ svn revert

11.1 Example

$ svn revert . -R
$ svn revert /PATH/TO/FILE

11.2 Git Equivalent

$ git checkout /PATH/TO/FILE

12. List latest revision

$ svn log

12.1 Example

$ svn log /PATH/TO/FILE -v -l3

12.2 Git Equivalent

$ git log -n 3

13. View diff of a commit

$ svn log --diff

13.1 Example

$ svn log -r 42256 --diff

13.2 Git Equivalent

$ git diff 29461219405dcdee17194d0e3112f160e1345d49

14. Merge Conflicts

Accept whatever the current directory structure is at this time:

$ svn resolve --accept working . -R

15. The "Git Way"

15.1 Clone Trunk

$ svn checkout https://code.example.com/repo/trunk repo

15.2 Create Feature Branch

$ svn copy https://code.example.com/repo/trunk \
    https://code.example.com/repo/features/feature_branch \
    -m "Creating a private branch of /repo/trunk."

15.3 Switch

$ svn switch https://code.example.com/repo/features/feature_branch

15.4 Make Changes

$ rm *.php
$ rails new awesome_app

15.5 Add New Files

$ svn status
$ svn add . --force

15.6 Commit New Files

$ svn commit -m "Made some awesome"

15.7 Switch to Trunk

$ svn switch https://code.example.com/repo/trunk

15.8 Update From Upstream

$ svn update

15.9 Merge New Feature

$ svn merge --reintegrate https://code.example.com/repo/features/feature_branch 

15.10 Commit Merge

$ svn commit -m "Merge branch feature_branch into trunk"

More Repositories

1

readingtime

Estimates reading time
Ruby
97
star
2

landing-page

A HTML Template of Kissmetrics' Anatomy Of A Perfect Landing Page
CSS
36
star
3

vanillacss

The place to go after you've added your reset
10
star
4

example.html

A mashup of the Normalize CSS, Inuit CSS and Kitchen Sink demo pages
HTML
9
star
5

paramsfile

Dynamically generate configuration files with YAML and Mustache
Ruby
5
star
6

dotfiles

My dotfiles and other machine setup
Shell
5
star
7

vagrant-ruby-dev-vm

Vagrant VM to develop Ruby code against
Shell
4
star
8

ansible-mysql-service

Ruby
4
star
9

anchors

Cheat sheet of things I forget you can do to anchor tags with CSS and some useful styles
4
star
10

feed-the-zettelkasten

Report on daily note-taking progress
Ruby
4
star
11

nginx-server-generator

Sinatra web service to generate simple nginx server configuration files
Ruby
3
star
12

on_writing_software_well

Snippets from the On Writing Software Well series hosted by David Heinemeier Hansson
Ruby
3
star
13

hunter

Hunter hunts for a pattern in your log files
Ruby
3
star
14

github_events_export

Export GitHub events to JSON files
Ruby
3
star
15

practical-oo-design-in-ruby

Code examples and experiments from Practical Object-Oriented Design in Ruby
Ruby
2
star
16

twalk

Twalk displays tweets of your followers who are talking to one another.
Ruby
2
star
17

image_to_html

CLI tool to OCR an image and output HTML containing the image and its extracted text.
Crystal
2
star
18

ampersat

Calculates which email domains your subscribers use
Ruby
2
star
19

garethrees.github.com

HTML
2
star
20

programming-elixir

Code examples and experiments from Programming Elixir
Elixir
2
star
21

jists

A Rails clone of GitHub Gist
Ruby
2
star
22

responsive

Using em's to define break points in responsive web design
1
star
23

gitio

Command line GitHub URL shortener
Shell
1
star
24

maps

Playing with Google Maps API
JavaScript
1
star
25

pagesapp

Experimenting with a simple wiki app
Ruby
1
star
26

site-down

A checklist of what to do when your site goes down
1
star
27

notify-osx

Simple notifier for OS X
Shell
1
star
28

sinatra-streaming

Playing around with the Sinatra Streaming module
Ruby
1
star
29

dsn

Ruby parser for RFC 3463 Delivery Status Notification codes
Ruby
1
star
30

fonts

CSS
1
star
31

pbd

1
star
32

hackdo

Find TODOs in any GitHub repository
Ruby
1
star
33

rack-floc-off

Tells Google not to impose Federated Learning of Cohorts (FLoC) on users
Ruby
1
star