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.
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:
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:
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:
To commit only some files:
cg-commit filename1 filename2 ...
If you have write access to the repo, you can push your changes so that they are available for everyone. This is done by:
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:
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.
Create new remote branch
This is how you create a remote branch, taken from .
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 push origin :heads/branch_name