bzr detailed introduction
1 Overview
Bazaar (bzr) is another open source DVCS (Distributed Version Control System), which tries to bring something new to the world of SCM (Source Code Management). bzr is a ubuntu linux distribution company, written by python. Simply understood as similar to the git function.
2. Download
- debian:
sudo apt-get -t lenny-backports install bzr
- Centos/RHEL
su -c 'rpm -Uvh http://dl.fedoraproject.org/pub/epel/5/i386/epel-release-5-4.noarch.rpm'
Then you can use yum to install the bzr package: su -c 'yum install bzr'
3. Use
- Create user
$ bzr whoami "John Doe <[email protected]>"
$ bzr whoami "[email protected]"
#check
$ bzr whami
- Create warehouses and branches
# 创建仓库
[root@db01 /home/chenjiaona/Downloads]# bzr init-repo chenjiaona
Shared repository with trees (format: 2a)
Location:
shared repository: chenjiaona
# 创建分支
[root@db01 /home/chenjiaona/Downloads]# bzr init chenjiaona/master
Created a repository tree (format: 2a)
Using shared repository: /home/chenjiaona/Downloads/chenjiaona/
# 创建文件
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# ls
test.txt
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr commit -m "test"
Committing to: /home/chenjiaona/Downloads/chenjiaona/master/
brz: ERROR: No changes to commit. Please 'brz add' the files you want to commit, or use --unchanged to force an empty commit.
(reverse-i-search)`ad': cd /home/chenjiaona/Downlo^Cs/
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr add .
adding test.txt
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr commit -m "test"
Committing to: /home/chenjiaona/Downloads/chenjiaona/master/
added test.txt
Committed revision 1.
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr add .
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr diff
=== modified file 'test.txt'
--- old/test.txt 2021-02-03 03:46:26 +0000
+++ new/test.txt 2021-02-03 03:46:43 +0000
@@ -1,1 +1,2 @@
aa
+ddd
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr log
------------------------------------------------------------
revno: 1
committer: [email protected]
branch nick: master
timestamp: Wed 2021-02-03 11:46:26 +0800
message:
test
- Parameter explanation
[root@db01 /home/chenjiaona/Downloads/chenjiaona/master]# bzr --help
Breezy 3.0.0dev1 -- a free distributed version-control tool
https://www.breezy-vcs.org/
Basic commands:
brz init makes this directory a versioned branch
brz branch make a copy of another branch
brz add make files or directories versioned
brz ignore ignore a file or pattern
brz mv move or rename a versioned file
brz status summarize changes in working copy
brz diff show detailed diffs
brz merge pull in changes from another branch
brz commit save some or all changes
brz send send changes via email
brz log show history of changes
brz check validate storage
brz help init more help on e.g. init command
brz help commands list all commands
brz help topics list all help topics