Add in the migrating from the old subversion / git docs. This section
should be removed in a few months maybe.
Contributions by: lwshu@, Alexander Richardson, kib@, Ceri Davies
At this point you have the src checked out into a Git tree, ready to
do other things.
===== But I have changes that I've not committed
If you are migrating from a tree that has changes you've not yet
committed to FreeBSD, you'll need to follow the steps from the
previous section first, and then follow these.
[source,shell]
....
% cd path-to-svn-checkout-tree
% svn diff > /tmp/src.diff
% cd mumble/freebsd-src
% git checkout -b working
....
This will create a diff of your current changes. The last command
creates a branch called `working` though you can call it whatever you
want.
[source,shell]
....
% git apply /tmp/src.diff
....
this will apply all your pending changes to the working tree. This
doesn't commit the change, so you'll need to make this permanent:
[source,shell]
....
% git commit
....
The last command will commit these changes to the branch. The editor
will prompt you for a commit message. Enter one as if you were
committing to FreeBSD.
At this point, your work is preserved, and in the Git repo.
===== Keeping current
So, time passes. It's time now to update the tree for the latest
changes upstream. When you checkout `main` make sure that you have no
diffs. It's a lot easier to commit those to a branch (or use `git
stash`) before doing the following.
If you are used to `git pull`, I would strongly recommend using the
`--ff-only` option, and further setting it as the default option.
Alternatively, `git pull --rebase` is useful if you have changes staged
in the main directory.
[source,shell]
....
% git config --global pull.ff only
....
[source,shell]
....
% cd freebsd-src
% git checkout main
% git pull (--ff-only|--rebase)
....
There is a common trap, that the combination command `git pull` will
try to perform a merge, which would sometimes creates a merge commit
sha that didn't exist before. This can be harder to recover from.
The longer form is also recommended.
[source,shell]
....
% cd freebsd-src
% git checkout main
% git fetch freebsd
% git merge --ff-only freebsd/main
....
These commands reset your tree to the main branch, and then update it
from where you pulled the tree from originally. It's important to
switch to `main` before doing this so it moves forward. Now, it's time
to move the changes forward:
[source,shell]
....
% git rebase -i main working
....
This will bring up an interactive screen to change the defaults.
For now, just exit the editor.
Everything should just apply.
If not, then you'll need to resolve the diffs.
https://docs.github.com/en/free-pro-team@latest/github/using-git/resolving-merge-conflicts-after-a-git-rebase[This github document] can help you navigate this process.
===== Time to push changes upstream
First, ensure that the push URL is properly configured for the upstream