Git

Git.

a cover alternative title

Git and Github Link to this heading

Checking out PRs locally for review Link to this heading

Git can checkout pull requests from a remote repository . This makes it easier to review pull requests locally, and to run tests against them.

Configuring Git to make checkout easier. Link to this heading

You can modify your .gitconfig file to include the PR namespace. This allows easier checkout of PRs and also shows the PRs in graphical tools like gitk.

edit the .git/config file Link to this heading

Make sure that you have a remote defined in your .git/config file that corresponds to the main FreeCAD repo. Ideally, this remote is named “upstream”. If you don’t have this remote defined, you can add it like this:

[remote "upstream"]
	url = git@github.com:FreeCAD/FreeCAD.git
	fetch = +refs/heads/*:refs/remotes/upstream/*

add the PR namespace Link to this heading

add a second fetch line to the upstream remote definition. This line will fetch the PR namespace from the upstream repo.

    fetch = +refs/pull/*/head:refs/remotes/upstream/pr/*

now you can fetch PRs with the command Link to this heading

git fetch upstream

checkout a PR Link to this heading

git checkout upstream/pr/1234