Ubuntu Unleashed 2019 Edition: Covering 18.04, 18.10, 19.04

(singke) #1

In Git, a commit does not change the remote files but only commits the
change to your local copy. If you want others to see your changes, you must
push the changes to them:


Click here to view code image
matthew@seymour:~$ git push
git://path_to_repository/directory/proj.git


Many open source projects that use Git host their code using GitHub. You can
find it at http://github.com.


Managing Software Projects with Bazaar


Bazaar was created by Canonical and first released in 2007 to host all
development files for Ubuntu and other projects. It is actively developed and
used by Canonical and Ubuntu developers and also by other open source
projects. Launchpad, covered later in this chapter, uses Bazaar.


Bazaar supports working with or without a central repository. Changes are
tracked over any and all files you check out, including multiple versions of
files. Source code control is done from the command line, as shown in the
following examples. You need to install Bazaar from the Ubuntu software
repositories, where it is called bzr.


There are two ways to create a new repository. If you are starting with an
empty directory, use the following:


Click here to view code image
matthew@seymour:~$ bzr init your_project_name


If you are creating a repository for an existing project, go to the top-level
directory for the project and enter the following:


Click here to view code image
matthew@seymour:~$ bzr init
matthew@seymour:~$ bzr add .


To check out code from an existing central repository, use this:


Click here to view code image
matthew@seymour:~$ bzr checkout your_project_name


To check your changes before you check them in, you can use bzr diff or
bzr cdiff. They do the same thing, but bzr cdiff does so with colored
output:


Click here to view code image

Free download pdf