Sandbox:Piffpoof8

From FreeCAD Documentation
Jump to: navigation, search

FreeCAD Examples Repo on Github

Introduction

The FreeCAD system is programmed, tested and documented by numerous people spread around the world. The Git protocol is used to coordinate the source code, the test data, and the example data. This page details the use of GitHub for FreeCAD Example Data.

There is a related page "Git for FreeCAD Users" that details GitHub usage for persons working on FreeCAD.


Create a Remote Git Repository (Forking)

First you will need to set up a GitHub account here: https://github.com/ You also need a git client software installed on your computer.

Once this is setup, in your browser navigate to https://github.com/FreeCAD/Examples, Log-on to GitHub and click the "fork" button in the upper right hand coner of the Webpage.

Click on the copy to clipboard icon to copy the URL of your newly created remote repository, we'll need this in the next step.

GitHub Local Repository Creation (Cloning)

Now simply open a terminal in the directory where you want to create your new local repository and enter [code]git clone https://github.com/GitHubUSERNAME/Examples.git[/code] Now you have a new local repository that is setup to track your remote repository.

Adding Files Files to Your Local Repositories Repository (Commiting)

It's always best to do any development in a "feature branch" of your local repository. To create a feature branch, in a terminal opened in your local repo directory type [code] git checkout -b YOURNEWBRANCHNAME[/code]

Now within your file manager or from the command line copy the files your wish to add. It's good to create a subdirectory with descriptive name to keep things organized.

To commit these new files to your new local repository, in a terminal from your local repo type [code] git commit -a -m "Description of your changes"[/code]

Updating your remote Repository with your new files (Pushing)

Next we must update our remore. From a terminal i your local repo enter [code]git push origin YOURLOCALBRANCHNAME[/code] You will be prompted for your USERNAME and PASSWORD.

On GitHubyou should now be able to see your new "feature branch"

Pull Requests

Syncing your local and remote repositories with upstream (Pull Push)

Now we will sync our remote and local repo's to the main FreeCAD/Wxamples repo.

First let's make sure we're back on our "master" branch. From a terminal in our local repo type [code]git checkout master [/code]

Next we'll add the official FreeCAD/Examples repos to our remotes and name it "upstream". Again into a terminal in your local repo type [code]git remaote add upstream https://github.com/freecad/examples









f

Miscellaneous Commands