Git For Subversion Users

ADVERTISEMENT

GIT
SUBVERSION
FOR
USERS
TOWER — the most powerful Git client for Mac
presented by
Creating a New Repository
Committing Local Changes
git init
With
, an empty repository is created in the current
Inspecting your current local changes is very similar in both systems.
folder of your local hard drive. The
git add
command then marks
SUBVERSION
the current contents of your project directory for the next (and in
$ svn status
this case: first) commit.
$ svn diff | less
SUBVERSION
GIT
$ svnadmin create /path/to/repo
$ git status
$ svn import /path/to/local/project http://
$ git diff
trunk -m "Initial import"
In case you’ve created new files or deleted old ones, you should tell
GIT
$ git init
Git with the
git add
and
git rm
commands. You’ll be pleased
$ git add .
to hear that it’s safe to inform Git after deleting or moving a file
$ git commit -m "Initial commit"
or even a folder. This means you should feel free to delete or move
even complete directory structures in your favorite editor, IDE, or
file browser and later confirm the action with the
add
and
rm|
Cloning a Remote Repository
commands.
Getting a copy of the project from a remote server seems almost
SUBVERSION
$ svn add <file>
git clone
identical. However, after performing
, you have a
$ svn rm <file>
full-blown local repository on your machine, not just a working
copy.
GIT
$ git add <file>
$ git rm <file>
SUBVERSION
$ svn checkout
svn+ssh://svn@ trunk
In its simplest form, committing can feel just like in Subversion.
-a
With the
option, you tell Git to simply add all current local
GIT
$ git clone
changes to the commit.
SUBVERSION
$ svn commit -m "message"
Inspecting History
GIT
$ git commit -a -m "message"
log
To inspect historic commits, both systems use the
command.
Keep in mind, however, that
git log
doesn’t need to ask the
Although short-circuiting Git’s staging area like this can make
remote server for data: your project’s history is already at hand,
sense, you’ll quickly begin to love it once you understand how
saved in your local repository.
valuable it is:
You can add selected files to the staging area and even limit this to
SUBVERSION
$ svn log | less
-p
certain parts (or even lines) of a file by specifying the
option.
This allows you to craft your commits in a very granular way and
GIT
$ git log
only add changes that belong to the same topic in a single commit.
GIT
$ git add <file1> <file2>
$ git add -p <file3>
30-day free trial available at
the most powerful Git client for Mac

ADVERTISEMENT

00 votes

Related Articles

Related forms

Related Categories

Parent category: Education
Go
Page of 2