/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to doc/en/mini-tutorial/index.txt

  • Committer: Matthew Revell
  • Date: 2007-10-16 11:06:30 UTC
  • mto: (2914.1.1 doc)
  • mto: This revision was merged to the branch mainline in revision 2915.
  • Revision ID: matthew.revell@canonical.com-20071016110630-0ij1zujgy2ylvchw
Ian, John AM, Poolie, John G comments acted on. Corrected bzr send section, used 'parent' instead of 'main' branch, included two publishing sections - one for LP and one for sftp.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
===================
2
 
Bazaar in 5 minutes
 
2
Bazaar in five minutes
3
3
===================
4
4
 
5
5
.. contents::
12
12
 
13
13
Over the next five minutes, you'll learn how to put your files under
14
14
version control, how to record changes to them, examine your work, publish
15
 
it and merge changes from someone else.
 
15
it and send your work for merger into a project's trunk.
16
16
 
17
 
If you'd prefer a more detailed introduction, take a look at our guide
 
17
If you'd prefer a more detailed introduction, take a look at 
18
18
`Learning More`_.
19
19
 
20
20
 
47
47
 
48
48
  $ bzr whoami "John Doe <john.doe@gmail.com>"
49
49
  
50
 
Bazaar will now create or modify a configuration file, including your name
51
 
and email address, at ``~/.bazaar/bazaar.conf``
 
50
Bazaar will now create or modify a configuration file, including your
 
51
name and email address.
52
52
 
53
53
Now, check that your name and email address are correctly registered::
54
54
 
65
65
 $ cd myproject
66
66
 $ mkdir subdirectory
67
67
 $ touch test1.txt test2.txt test3.txt subdirectory/test4.txt
 
68
 
 
69
**Note for Windows users:** use Windows Explorer to create your
 
70
directories, then right-click in those directories and select 
 
71
``New file`` to create your files.
68
72
 
69
 
Now get Bazaar to initalise itself in that directory::
 
73
Now get Bazaar to initalize itself in your project directory::
70
74
 
71
75
  $ bzr init
72
76
  
86
90
 added subdirectory/test4.txt
87
91
 
88
92
Next, take a snapshot of your files by committing them to your branch. Add 
89
 
a commit message to explain why you made the commit::
 
93
a message to explain why you made the commit::
90
94
 
91
95
  $ bzr commit -m "Initial import"
92
96
  
110
114
 @@ -0,0 +1,1 @@
111
115
 +test test test
112
116
 
113
 
Commit your work to your Bazaar branch::
 
117
Commit your work to the Bazaar branch::
114
118
 
115
119
  $ bzr commit -m 'Added first line of text'
116
120
  Committed revision 2.
138
142
    Initial import
139
143
 
140
144
 
141
 
Publishing Your Branch
142
 
======================
143
 
 
144
 
There are a couple of ways to publish your branch but the easiest way is to
145
 
push it to Launchpad_, the free software project hosting service.
 
145
Publishing your branch with sftp
 
146
================================
 
147
 
 
148
There are a couple of ways to publish your branch. If you already have
 
149
an SFTP server or are comfortable setting one up, you can publish your
 
150
branch to it.
 
151
 
 
152
Otherwise, skip to the next section to publish with Launchpad_, a free
 
153
hosting service for Bazaar.
146
154
 
147
155
.. _Launchpad: https://launchpad.net/
148
156
 
 
157
Let's assume you want to publish your branch at ``www.example.com/myproject``::
 
158
 
 
159
 $ bzr push --create-prefix sftp://your.name@example.com/~/public_html/myproject
 
160
 2 revision(s) pushed.
 
161
 
 
162
Bazaar will create a ``myproject`` directory on the remote server and
 
163
push your branch to it.
 
164
 
 
165
**Note:** that to use sftp, your may need to install ``paramiko`` and
 
166
``pyCrypto``. See http://bazaar-vcs.org/InstallationFaq for details.
 
167
 
 
168
Now anyone can create their own copy of your branch by typing::
 
169
 
 
170
 $ bzr branch http://www.example.com/myproject
 
171
 
 
172
 
 
173
Publishing your branch with Launchpad
 
174
=====================================
 
175
 
 
176
Launchpad is a suite of development and hosting tools for free 
 
177
software projects. You can use it to publish your branch.
 
178
 
149
179
If you don't have a Launchpad account, follow the `account signup guide`_
150
 
and `register an SSH key`_ in your Launchpad account.
 
180
and `register an SSH key`_ in your new Launchpad account.
151
181
 
152
182
.. _account signup guide: https://help.launchpad.net/CreatingYourLaunchpadAccount
153
183
.. _register an SSH key: https://launchpad.net/people/+me/+editsshkeys
156
186
 
157
187
 $ bzr push bzr+ssh://john.doe@bazaar.launchpad.net/~john.doe/+junk/myproject
158
188
 
159
 
``+junk`` means that this branch isn't associated with any particular
 
189
**Note:** ``+junk`` means that this branch isn't associated with any particular
160
190
project in Launchpad.
161
191
 
162
192
Now, anyone can create their own copy of your branch by typing::
163
193
 
164
194
 $ bzr branch http://bazaar.launchpad.net/~john.doe/+junk/myproject
165
195
 
166
 
Their branch will have all the same files, with the same revision history
167
 
as yours but any changes they make will stay in their own branch. You
168
 
can merge your branches at any time.
169
 
 
170
 
**Note:** you can also push your branch to `your own server using sftp`_.
171
 
 
172
 
.. _your own server using sftp: push-with-sftp/
 
196
You can also see information about your branch, including its revision
 
197
history, at https://code.launchpad.net/people/+me/+junk/myproject
173
198
 
174
199
 
175
200
Creating your own copy of another branch
176
201
========================================
177
202
 
178
 
You can also make your own branch of someone else's work. Let's take a
179
 
real-world example, Bazaar's GTK interface::
 
203
To work with someone else's code, you can make your own copy of their 
 
204
branch. Let's take a real-world example, Bazaar's GTK interface::
180
205
 
181
206
  $ bzr branch http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk bzr-gtk.john
182
207
  Branched 292 revision(s).                                                        
184
209
Bazaar will download all the files and complete revision history from the
185
210
bzr-gtk project's trunk branch and create a copy called bzr-gtk.john.
186
211
 
187
 
Now, you have your own copy of the branch and can commit any changes you want
188
 
even without a net connection. You can share your branch at any time by 
189
 
publishing it and, if the  bzr-gtk team want to use your work, Bazaar makes it 
190
 
easy for them to merge your branch back into their trunk branch.
 
212
Now, you have your own copy of the branch and can commit changes with 
 
213
or without a net conncetion. You can share your branch at any time by 
 
214
publishing it and, if the  bzr-gtk team want to use your work, Bazaar 
 
215
makes it easy for them to merge your branch back into their trunk branch.
191
216
 
192
217
 
193
218
Updating your branch from the main branch
194
219
=========================================
195
220
 
196
221
While you commit changes to your branch, it's likely that other people will
197
 
also continue to commit code to the main branch.
 
222
also continue to commit code to the parent branch.
198
223
 
199
224
To make sure your branch stays up to date, you should merge changes from
200
 
the main branch into your personal branch::
 
225
the parent into your personal branch::
201
226
 
202
227
  $ bzr merge
203
228
  Using saved location: http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk
214
239
  Committed revision 295.
215
240
 
216
241
 
217
 
Merging your work
218
 
=================
219
 
 
220
 
After you've worked on your personal branch of a project, you may want to
221
 
send your changes back upstream. The easiest way is to use a Bazaar bundle.
222
 
 
223
 
Bundles are similar to patches, except they include revision history
224
 
from your branch.
225
 
 
226
 
To have Bazaar produce a bundle and email it to the project, replace
227
 
``project@projectdomain.com`` and type::
228
 
 
229
 
 $ bzr send --mail-to=project@projectdomain.com
230
 
 
 
242
Merging your work into the parent branch
 
243
========================================
 
244
 
 
245
After you've worked on your personal branch of bzr-gtk, you may want to
 
246
send your changes back upstream to the project. The easiest way is to
 
247
use a Bazaar bundle.
 
248
 
 
249
Bundles are similar to patches but with added intelligent metadata,
 
250
such as revision history. They include all the information needed to
 
251
merge your branch back into the parent.
 
252
 
 
253
Replacing ``mybundle.patch``, create your bundle::
 
254
 
 
255
 $ bzr send -o mybundle.patch
 
256
 Using saved location: http://bazaar.launchpad.net/~bzr/bzr-gtk/trunk
 
257
 
 
258
You can now email the bundle to the upstream project who can, if they
 
259
choose, merge it back into trunk, i.e. the parent branch.
 
260
 
 
261
 
231
262
Learning more
232
263
=============
233
264
 
234
 
Now you've seen how to put your files under version control, make your
235
 
branch of someone else's work and send your code for merger with someone
236
 
else's branch.
237
 
 
238
265
You can find out more about Bazaar in the `Bazaar user guide <../../index.html>`_.
239
266
 
240
267
To learn about Bazaar on the command-line::