Working with Git
From Thousand Parsec Wiki
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.
Here are some instructions to help you get started with Git.
Contents |
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
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
