~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

(mbp) improvements and corrections to mini-tutorial (Martin Pool)

Show diffs side-by-side

added added

removed removed

Lines of Context:
61
61
 
62
62
::
63
63
 
64
 
  bzr init-repo sample
65
 
  cd sample
66
 
  bzr init trunk
67
 
  cd trunk
 
64
  $ bzr init-repo sample
 
65
  Shared repository with trees (format: 2a)
 
66
  Location:
 
67
    shared repository: sample
 
68
  $ bzr init sample/trunk
 
69
  $ cd sample/trunk
 
70
  Created a repository tree (format: 2a)                                         
 
71
  Using shared repository: /home/john/sample/
68
72
 
69
73
 
70
74
Making changes to your files
72
76
 
73
77
Let's change a file and commit that change to your branch.
74
78
 
75
 
Edit ``test1.txt`` in your favourite editor, then check what have you done::
 
79
Edit ``test1.txt`` in your favourite editor, then use ``bzr add`` to tell bzr
 
80
to track changes to this file ::
 
81
 
 
82
  $ echo test test test > test1.txt 
 
83
  $ bzr add test1.txt
 
84
  adding test1.txt
 
85
 
 
86
`bzr diff` shows the changes between the last revision in this branch, and your
 
87
current tree (or, with the ``-r`` option, between any two trees). ::
76
88
 
77
89
 $ bzr diff
78
90
 === modified file 'test1.txt'
84
96
Commit your work to the Bazaar branch::
85
97
 
86
98
  $ bzr commit -m "Added first line of text"
87
 
  Committed revision 2.
88
 
 
 
99
  Committing to: /home/john/sample/trunk/                             
 
100
  added test1.txt
 
101
  Committed revision 1.
89
102
 
90
103
Viewing the revision log
91
104
========================
93
106
You can see the history of your branch by browsing its log::
94
107
 
95
108
  $ bzr log
96
 
  ------------------------------------------------------------
97
 
  revno: 2
98
 
  committer: John Doe <john.doe@gmail.com>
99
 
  branch nick: myproject
100
 
  timestamp: Mon 2007-10-08 17:56:14 +0000
101
 
  message:
102
 
    Added first line of text
103
 
  ------------------------------------------------------------
104
109
  revno: 1
105
110
  committer: John Doe <john.doe@gmail.com>
106
 
  branch nick: myproject
 
111
  branch nick: trunk
107
112
  timestamp: Mon 2006-10-08 17:46:22 +0000
108
113
  message:
109
114
    Initial import
116
121
software projects. You can use it to publish your branch.  (You can 
117
122
also publish branches onto your own server or other hosting services.)
118
123
 
119
 
If you don't have a Launchpad account, follow the `account signup guide`_
120
 
and `register an SSH key`_ in your new Launchpad account.
121
 
 
122
 
.. _account signup guide: https://help.launchpad.net/CreatingYourLaunchpadAccount
123
 
.. _register an SSH key: https://launchpad.net/people/+me/+editsshkeys
124
 
 
125
 
Replacing ``john.doe`` with your own Launchpad username, type::
126
 
 
127
 
 $ bzr push lp:~john.doe/+junk/myproject
128
 
 
129
 
**Note**: ``+junk`` is a place to store experimental branches not
130
 
associated with any particular project.  Normally, you should push a
131
 
project into an existing project, or register a new project through the
132
 
web interface.
133
 
 
134
 
Now, anyone can create their own copy of your branch by typing::
135
 
 
136
 
 $ bzr branch lp:~john.doe/+junk/myproject
137
 
 
138
 
You can also see information about your branch, including its revision
139
 
history, at https://code.launchpad.net/people/+me/+junk/myproject
140
 
 
 
124
The steps to publishing branches on Launchpad are:
 
125
 
 
126
1. Create a Launchpad account: visit the `Launchpad login page`_ and choose to create a new account.
 
127
    
 
128
.. _Launchpad login page: https://launchpad.net/+login
 
129
    
 
130
2. Bazaar uses the SSH encryption and authentication protocol to connect
 
131
   to Launchpad.  You need to first `create an SSH key`_ on your own computer,
 
132
   by running the command::
 
133
    
 
134
       $ ssh-keygen
 
135
 
 
136
.. _create an SSH key: https://help.launchpad.net/YourAccount/CreatingAnSSHKeyPair    
 
137
       
 
138
3. `Upload your SSH public key to Launchpad`_.
 
139
 
 
140
.. _Upload your SSH public key to Launchpad: https://launchpad.net/~/+editsshkeys
 
141
    
 
142
4. `Make a team for your project`_.  Even if you're starting as the only
 
143
   developer on this project, creating a new now will let you more easily 
 
144
   add other people later.
 
145
 
 
146
.. _Make a team for your project: https://help.launchpad.net/Teams/CreatingAndRunning
 
147
      
 
148
5. `Create a project`_.
 
149
  
 
150
.. _Create a project: https://help.launchpad.net/Projects/Registering
 
151
 
 
152
6. Tell Bazaar your Launchpad account name.  If your account is john.doe, type ::
 
153
  
 
154
      $ bzr launchpad-login john.doe
 
155
 
 
156
7. `Push the branch for your project`_.  Once you've committed your changes 
 
157
   locally, you can publish them as the trunk of your new project by saying
 
158
    
 
159
       $ bzr push lp:~sample-developers/sample/trunk
 
160
       
 
161
   (Of course, using the team and project names you just chose.)
 
162
 
 
163
.. _Push the branch for your project: https://help.launchpad.net/Code/UploadingABranch
141
164
 
142
165
Creating your own copy of another branch
143
166
========================================