First of all, thank you for taking an interest in contributing to my projects. While every project is different, the process generally looks like this:
The entire process is centered around Git. If you’re new to Git, then this process will probably be overwhelming. If you already have experience with Git, then you’ll probably want to skim through this document and only read the parts that look unfamiliar to you. The first thing you’ll need to do is clone the project’s repo. Run this command in a terminal: Here’s where you can find a project’s repo’s URL… See GitLab’s official documentation. See GitHub’s official documentation. Eventually, you’re (probably) going to want to test out your changes. Before you do, it’s a good idea to test out an unchanged version of the project. Every project is different, so open up the repo you just cloned and start looking through the README. You should be able to figure out how to run or use the project by reading the README or by reading files that the README references. If you can’t, then please email me questions because the project’s documentation should probably be improved. In Git, a branch is like a timeline. Each branch contains a sequence of snapshots. Each of those snapshots is a single event in the branch’s history. Open a terminal in your clone’s directory, and run this command: Git will then tell you what branch you’re currently on. It will also list any other branches that you add to your clone. Your current branch will probably be named “main” (I think that the default branch for most of my repos is named “main”). To stay organized, it’s a good idea to create a new branch for each of your patches. To do so: If the repo doesn’t have a branch named “main”, then adjust that command accordingly. At this point, you’ve created your own branch but haven’t added anything to it yet. At the moment, your branch is identical to the main branch. Now it’s time to get to work. Create new files, delete old files or edit existing files. Don’t worry too much about making an unwanted change because Git is already holding onto multiple snapshots of the files in the repo. Every so often, you should create one of these snapshots. To do so: Once you’ve created one or more commits, it’s time to turn those commits into a patch and send them to me. You have four different options. For your first patch I recommend choosing the first one. This strategy is good for people who already have some experience with Git. It’s not recommended for new users. Patches should be sent to “jason@jasonyundt.email”. If you don’t already know how to use Most of the options that you can pass to Get a copy of the repository on your system
git clone <repo-URL>
…if the project is hosted on Jason’s Web Site.
…if the project is hosted on
pagure.io
.…if the project is hosted on
gitlab.com
.…if the project is hosted on
github.com
.Try out the project on your system
Create a branch that contains your proposed changes
git branch
git branch
git checkout main
git branch <branch-name>
git checkout <branch-name>
git status
You can run git add <path-to-file>
git rm <path-to-file>
git mv <old-path> <new-path>
git status
again to see what changes are staged and unstaged.
This will create a new commit and put it at the tip of your current branch. In Git, snapshots are called “commits”.git commit
Send your patch to me
What to do if the repo is hosted on Jason’s Web Site.
Easiest:
git-bundle
to get a list of branches.git branch
That command is a little bit tricky. It creates a bundle file named “git bundle create <your-branch>.bundle main..<your-branch>
<your-branch>.bundle
”. The last part of the command tells Git what to put into your bundle. “main..<your-branch>
” means “every commit that’s in <your-branch>
, but isn’t in main yet”.Easy:
git-format-patch
+ compression
to get a list of branches.git branch
git format-patch \
-o patch-v1 \
--to='jason@jasonyundt.email' \
--subject-prefix='PATCH <repo-name>' \
main..<your-branch>
If you’re interested in what that command does, then click here.
or you can use another method that you’re more familiar with.tar -cf patch-v1-compressed.tar.zst --zstd patch-v1
Medium:
git-request-pull
Make sure that git remote add pr <remote-repo-URL>
<remote-repo-URL>
is a publicly accessible URL (use HTTPS, not SSH).
to get a list of branches.git branch
git push pr <your-branch>
git request-pull main pr <your-branch>
Hard:
git-format-patch
+ git-send-email
git-send-email
, then check out git-send-email.io
. I’ll give you some advice that git-send-email.io
doesn’t mention: you can generate patch files using git-format-patch
(don’t compress them), and then send them using git-send-email
:git send-email <directory-that-contains-patch-files>
git-send-email
(like --to
, --cc
or -v2
) can also be passed to git-format-patch
.What to do if the repo is hosted on
pagure.io
.
“pr” is just a name. You can call your remote whatever you want.git remote add pr <your-fork’s-URL>
to get a list of branches.git branch
git push pr <your-branch>
What to do if the repo is hosted on
gitlab.com
.
“pr” is just a name. You can call your remote whatever you want.git remote add pr <your-fork’s-URL>
to get a list of branches.git branch
git push pr <your-branch>
What to do if the repo is hosted on
github.com
.
“pr” is just a name. You can call your remote whatever you want.git remote add pr <your-fork’s-URL>
to get a list of branches.git branch
git push pr <your-branch>