You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For this plugin to work, you'll also need the `fastimport` Python module.
42
45
You can check whether it is present or not and install it with the following commands:
46
+
43
47
[source,console]
44
48
----
45
49
$ python -c "import fastimport"
@@ -55,50 +59,54 @@ So in this case you have nothing to do.
55
59
56
60
At this point, the way to import a Bazaar repository differs according to that you have a single branch or you are working with a repository that has several branches.
57
61
58
-
59
62
===== Project with a single branch
60
63
61
64
Now `cd` in the directory that contains your Bazaar repository and initialize the Git repository:
65
+
62
66
[source,console]
63
67
----
64
68
$ cd /path/to/the/bzr/repository
65
69
$ git init
66
70
----
67
71
68
72
Now, you can simply export your Bazaar repository and convert it into a Git repository using the following command:
73
+
69
74
[source,console]
70
75
----
71
76
$ bzr fast-export --plain . | git fast-import
72
77
----
73
78
74
79
Depending on the size of the project, your Git repository is built in a lapse from a few seconds to a few minutes.
75
80
76
-
77
81
===== Case of a project with a main branch and a working branch
78
82
79
83
You can also import a Bazaar repository that contains branches.
80
84
Let us suppose that you have two branches: one represents the main branch (myProject.trunk), the other one is the working branch (myProject.work).
Now `git branch` shows you the `master` branch as well as the `work` branch.
109
117
Check the logs to make sure they’re complete and get rid of the `marks.bzr` and `marks.git` files.
110
118
119
+
===== Synchronizing the staging area
111
120
112
-
===== Synchronize the staging area
113
-
114
-
Whatever the number of branches you had and the import method you used, your staging area is not synchronized with HEAD, and with the import of several branches, your working directory is not synchronized neither.
121
+
Whatever the number of branches you had and the import method you used, your staging area is not synchronized with `HEAD`, and with the import of several branches, your working directory is not synchronized either.
115
122
This situation is easily solved by the following command:
123
+
116
124
[source,console]
117
125
----
118
126
$ git reset --hard HEAD
119
127
----
120
128
129
+
===== Ignoring the files that were ignored with .bzrignore
121
130
122
-
===== Ignore the files that were ignored with .bzrignore
123
-
124
-
Now let us have a look at the files to ignore.
131
+
Now let's have a look at the files to ignore.
125
132
As `.bzrignore`'s format is completely compatible with `.gitignore`'s format, the simplest is to rename your `.bzrignore` file.
126
133
You will also have to create a commit that contains this change for the migration:
134
+
127
135
[source,console]
128
136
----
129
137
$ git mv .bzrignore .gitignore
130
138
$ git commit -am 'Migration from Bazaar to Git'
131
139
----
132
140
133
-
134
141
===== Send your repository to the server
135
142
136
143
Here we are!
137
144
Now you can push the repository onto its new home server:
0 commit comments