Forks¶
A fork in SourceLab is a copy of a repository. When contributing to a project on SourceLab, the first step is to fork it. This gives you a place to make changes to the project and, if you so wish, contribute back to the original project. If you're not already familiar with Git's distributed workflow, the Pro Git book has an excellent introduction.
You can see a list of projects you've forked on your home page.
Create a Fork on SourceLab¶
To fork a project, simply navigate to the project on SourceLab and click the fork button. You will then be redirected to your new fork.
Configure your Local Git Repository¶
Now that you have forked the project on SourceLab, you're ready to configure a local copy of the repository so you can get to work. First, clone the repository. The URL for the repository is on the right-hand side of the project overview page. For example:
After cloning your fork locally, it's a good idea to add the upstream repository as a git remote. For example:
This lets you pull in changes that the upstream repository makes after you forked. Consult Git's documentation for more details.
Pushing Changes¶
After you Configure your Local Git Repository you're ready to make your changes and contribute them upstream. First, start a new branch:
It's a good idea to give the branch a descriptive name so you can find it later. Next, make your changes. Once you're satisfied, add the changes to Git's staging area and commit the changes:
Your text editor of choice will open and you can write your commit message. If you have not done so already Upload your SSH key now. Afterwards, you are ready to push your changes to your remote fork:
In case you cloned the repo via HTTP, for example using a command like git clone https://..., the push will fail. Pagure.io does not support pushing over HTTP. An easy workaround is to use:
You are now ready to Open a Pull Request.