~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

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

  • Committer: Tarmac
  • Author(s): Vincent Ladeuil
  • Date: 2017-01-30 14:42:05 UTC
  • mfrom: (6620.1.1 trunk)
  • Revision ID: tarmac-20170130144205-r8fh2xpmiuxyozpv
Merge  2.7 into trunk including fix for bug #1657238 [r=vila]

Show diffs side-by-side

added added

removed removed

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