Skip to content

Latest commit

 

History

History
90 lines (54 loc) · 3.14 KB

Working_with_Git.mediawiki

File metadata and controls

90 lines (54 loc) · 3.14 KB

Thousand Parsec uses Git to manage its source code. Git is a distributed version control system that was at first created for Linux kernel development and has since then become popular with other open source projects.

Table of Contents

User guide

Here are some instructions to help you get started with Git.

Cogito

Before you start it is advisable to also install Cogito. Cogito is a user-friendly frontend to Git, which makes Git easier to use. While newest versions of Git include some features from Cogito, Cogito is still a nice tool to have around.

Where is the source code

All the source code for Thousand Parsec sub-projects is available in our central repository. Developers first commit the changes to their local repository and when they get to the Internet connection push all the commits to the central server.

To see the summary of the sub-project just click on it's name in the on-line browser. This way you get the URLs you can use to get the code and some other information like short changelog.

Getting the code

This is how you download the code from a remote repository to your local one:

Cogito:

 cg-clone git://git.thousandparsec.net/git/'''project-name'''.git

Where you replace project-name with the actual name of the desired project.

Updating the code

When you already have the code and would like to update it to the latest revision you issue this command from within the project's folder:

Cogito:

 cg-update

Committing changes

To check what changes are going to be commit, cg-status tells you what files, cg-diff gives a diff.

To commit all the changes:

Cogito:

 cg-commit

To commit only some files:

Cogito:

 cg-commit ''filename1'' ''filename2'' ...

Pushing changes

If you have write access to the repo, you can push your changes so that they are available for everyone. This is done by:

Cogito:

 cg-push

Note: git-push and cg-push might not push to the same branch! Be very careful!

Sending patches by email

If you don't have write access to the repo, you can format your patches and attach them to an email to the mailing list or one of the developers. This can be done by first committing you changes into patches, then running:

git:

 git-format-patch ''origin''

See Also

Admin guide

Because we can't remember everything, we document it here.

Applying patches that arrived by email

If you are not sure about the patch, create a new branch and apply it there to review, if needed.

git:

 git-am ''filename''

Create new remote branch

This is how you create a remote branch, taken from http://www.zorched.net/2008/04/14/start-a-new-branch-on-your-remote-git-repository/.

git:

 git push origin origin:refs/heads/''branch_name''
 git fetch origin
 git checkout --track -b ''branch_name'' origin/''branch_name''
 git pull

Remove remote branch

Remove a remote branch that is not needed anymore.

git:

 git push origin :heads/''branch_name''