Import svn branch to git

I am new to git and have a subversion repository that I want to import into the git repository from time to time (for deployment). So I want to do most of the updates using svn, but would like to see how best to push it to git (only the default branch / wizard).

+3
source share
3 answers

I know that you want to import the master / trunk branch of your svn repository, but I would like to mention svn2git to import your svn into the git repository.

This is better than git svn clonebecause if you have this code in svn:

  trunk
    ...
  branches
    1.x
    2.x
  tags
    1.0.0
    1.0.1
    1.0.2
    1.1.0
    2.0.0

git-svn git.
svn, , , git - git.
:

  $ git branch
  * master
  $ git branch -a
  * master
    1.x
    2.x
    tags/1.0.0
    tags/1.0.1
    tags/1.0.2
    tags/1.1.0
    tags/2.0.0
    trunk
  $ git tag -l
  [ empty ]

, svn2git , :

  $ git branch
  * master
    1.x
    2.x
  $ git tag -l
    1.0.0
    1.0.1
    1.0.2
    1.1.0
    2.0.0

, , HEAD svn-.

+5

git ? .

  • git svn clone SVN git.
  • git , git remote add .
  • SVN, git svn dcommit
+3

:

mkdir my_blog_tmp
cd my_blog_tmp
git-svn init http://code.yoursite.net/my_blog/trunk/ --no-metadata
git config svn.authorsfile ~/Desktop/users.txt
git-svn fetch

! - - () svn.

+1

Source: https://habr.com/ru/post/1702735/


All Articles