Using Fedora GIT/zh-cn

Cookbooks
Refer to How to update a package if you want to update an existing package.

New package process for existing contributors gives step-by-step instructions for that case.

Commands
Here is a basic table of equivalent commands:

Anonymous checkout
If you need anonymous clone (checkout) without fedpkg, you can use git: git clone git://pkgs.fedoraproject.org/libfoo for package

Merging
Merging is one of the things that we can now do directly in the VCS that we had to do with an external diff program in CVS. Getting used to how it works may take a little adjustment though.

Initial Merging
First, the way we imported from cvs means that we have to do a little work to make the older release branches "mergable" (F-14, since it branched after the conversion to git, doesn't need this).

fedpkg clone bzrtools cd bzrtools git merge origin/f13/master git merge origin/f12/master git merge origin/el6/master git merge origin/el5/master
 * 1) If no conflicts proceed to the next step.
 * 2) Otherwise, resolve the conflicts, git add & git commit, and then move on

Potentially better alternative to the above (without conflicts, without actually changing the master content, and merging ALL former CVS branches which are supposed to be the same package):

fedpkg clone menu-cache cd menu-cache git merge -m "Initial pseudo merge for dist-git setup" -s ours origin/{f12,f13}/master
 * 1) implicitly we have the master branch checked out here

Merging in normal operation
Now when you make changes on one branch and want to move them to a different branch, you can use git to merge those changes.

fedpkg clone bzrtools fedpkg new-sources bzrtools-2.2.tar.gz vim bzrtools.spec git commit fedpkg switch-branch f14 git merge master git push
 * 1) Make some changes in the master branch
 * 1) for push into repo

Resolving merge conflicts
When you git merge and a conflict occurs you still edit the files that have conflicts. Remove the conflict markers in the files and merge the changes manually. Then you need to commit your changes. Do that with

Using to resolve conflicts
Git allows you to set a graphical diff program to help resolve conflicts. This can be handy for visualizing what changes have occurred and deal with them as a set. git config --global merge.tool meld fedpkg switch-branch f13 git merge master git mergetool # Opens up a meld showing a three way diff of the merge, working tree, and the last commit git add CONFLICTEDFILES git commit
 * 1) Conflicts occurred
 * 1) Resolved all the conflicts in the GUI

Access denied
During the next few days and weeks, occasional tweaking to the servers might cause short periods (seconds or minutes) when the git server refuses you access. Just try again.

Unable to switch
If you are trying switch to another branch by fedpkg switch-branch f13 and see this: Unable to switch to another branch: Could not create branch f13

Then you probably have some un-commited changes in master. If you want them, call: git stash fedpkg switch-branch f13 git stash apply
 * 1) this "saves" your changes
 * 1) switch to preferred branch, now possible
 * 1) apply "saved" changes into the current branch

ssh fingerprint
The recommended option is to include " " in your ~/.ssh/config file. This will result in using DNS to check that the key is correct.

But you can also manually check against the list of keys at https://admin.fedoraproject.org. The strings there are what ends up in your ~/.ssh/known_hosts file. So you can accept the fingerprint when prompted and then check that the correct string for pkgs.fedoraproject.org ended up in your ~/.ssh/known_hosts file.