The below wiki article is based on user submitted content. Please verify all hyperlinks and terminal commands below!
See a mistake? Want to contribute? Edit this article on Github
This is a guide to a typical Git workflow with yuzu. It covers forking from the main repository, creating a branch, keeping your branch up to date with the main repository, resolving conflicts, and merging back into the main repository. It’s not meant to be a hard-and-fast set of rules. However, if you follow something along these lines, you’ll be less likely to piss people off.
It’s appreciated if every single commit in a branch on its own compiles on all supported platforms (Windows, Linux, and OS X) and doesn’t cause any regressions if the commits after it were left unmerged. We understand that with early development, sometimes it’s easier to commit early-and-often, and sometimes you may unintentionally break things (and then later fix them in your branch). If this is part of your workflow, we expect appropriate use of Git rebase to squash broken commits and resolve merge conflicts. If you don’t know how Git rebase works, please read this article before developing for yuzu.
upstream
: Main project repository (https://github.com/yuzu-emu/yuzu)origin
: Your GitHub forked project repository (e.g. https://github.com/bunnei/yuzu)git clone https://github.com/your-username/yuzu.git
git submodule update --init --recursive
upstream
to the main project repository
git remote add upstream https://github.com/yuzu-emu/yuzu.git
git config --global user.name "your-username"
git config --global user.email [email protected]
upstream/master
(Note: please format-branch-names-like-this)
git fetch upstream && git checkout -b new-branch-name upstream/master
origin
(required later for a pull request)
git push origin new-branch-name
upstream/master
that you want!git checkout new-branch-name
upstream/master
onto it. With the rebase, move all of your changes to the top, and put all of the new master changes immediately after where you branched from. The goal should be that the branch now appears as though you just created it from upstream/master
, and then committed all of your new stuff.
git rebase upstream/master
upstream/master
that will cause conflicts when trying to get the branch merged back to upstream/master!upstream/master
git checkout new-branch-name
git rebase -i upstream/master
To append changes to the most recently made commit, simply perform the following:
Stage the changed files to append to the commit with either:
git add
git add -u
to stage all modified files.Enter:
git commit --amend
— if you want to also change your commit messagegit commit --amend --no-edit
— if you want to append your changes to the commit and make no changes to the commit messageDone
upstream/master
git checkout new-branch-name
git rebase -i upstream/master
origin/new-branch-name
git push origin new-branch-name --force
origin/new-branch-name
into upstream/master
git checkout new-branch-name
git rebase -i upstream/master
pick
with fixup
. Re order if required (beware, you might get conflicts at this stage! Resolve them carefully, then use git rebase --continue
)pick
with reword
.origin/new-branch-name
git push origin new-branch-name --force
upstream/master
into your branch). If things don’t work for you, don’t hesitate to ask us for help @ #yuzu-emu on libera or @ #yuzu-general on Discord. Mastering Git is not as easy as it might sound, but we’ll happily help you get started.Advertisement
Advertisement