Difference between revisions of "Sandbox:Piffpoof"

From FreeCAD Documentation
Jump to: navigation, search
(Introduction)
 
(39 intermediate revisions by the same user not shown)
Line 1: Line 1:
 
{{VeryImportantMessage|'''Sandbox Page for "Piffpoof"'''}}
 
{{VeryImportantMessage|'''Sandbox Page for "Piffpoof"'''}}
=Git for FreeCAD Users=
 
==Introduction==
 
The [http://www.freecadweb.org/ FreeCAD] system is programmed, tested and documented by numerous people spread around the world. The
 
[http://git-scm.com/ Git] protocol is used to coordinate all the working and archive source code, the test data, as well as the changes and version history. FreeCAD uses a separate website for discussion [http://forum.freecadweb.org/ forums] and a documentation [http://www.freecadweb.org/wiki/index.php?title=Main_Page Wiki]. The [http://git-scm.com/ Git] system is a distributed revision control system and is free software under the GNU General Public License, it's documentation is available at [http://git-scm.com/doc Git-Documentation]) The Git protocol allows persons involved with the FreeCAD project to work independently and coordinate documents (e.g. code, data) with each other as needed. New versions of FreeCAD are generated using Git and bugs are identified and rectified using Git. The Git protocol provides the following services for the FreeCAD project:
 
  
* distributed revision control
+
This holds (or points to) things of a transient nature being worked on by Piffpoof.
* source code management
 
* a command-line tool
 
* web-based graphical interface via the desktop
 
* access control
 
  
As Git is a protocol for communication and exchange of data, any software that implements the protocol can participate. Different FreeCAD users work with different Git tools, some of which are:
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof4|Linking Scripts and FreeCAD files to Wiki Pages]]>>>
  
* Gitorious
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof1|Git for Users]]>>>
* GitLab
 
* BitBucket
 
* sourceforge
 
* GitHub
 
  
FreeCAD uses Git in two main areas:
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof5|Macro SelectVisible]]>>>
  
* source code management and system build
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof6|Groups]]>>>
* storage and revision control of data files
 
  
Building the FreeCAD system is covered in a separate document, the remainder of this document covers Git for non-developers.
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof7|FreeCAD GUI for Data Manipulation]]>>>
  
==Setting up Git and GitHub==
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof8|Examples on GitHub]]>>>
===Getting a GitHub Signon ID===
 
The FreeCAD repositories are located on the GitHub servers and each GitHub user must have a User ID so the first thing is to get set up. Go to www.github.com where you will supply the usual:
 
  
* User Name
 
* contact email account
 
* password
 
  
Select the the plan that suits your needs, the Free account (0$ per month for 0 private repositories) is sufficient for working with the FreeCAD repositories.
+
::All the following tutorials use Example Files on GitHub:
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-0|Tutorial Examples 0 - Tutorials Overview]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-1a|Tutorial Examples 1a - Lock Housing tutorial using Part wb & Pocket]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-1b|Tutorial Examples 1b - Lock Housing tutorial using Part Design wb & Sketcher]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-1c|Tutorial Examples 1c - Lock Housing tutorial using Part wb & Thickness]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-2a|Tutorial Examples 2a - Key tutorial using Part Design wb & Sketcher]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-2b|Tutorial Examples 2b - Key tutorial using Part wb & Booleans]]>>>
 +
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof9-3|Tutorial Examples 3 - Animation of Key tutorial]]>>>
  
You are now ready to set up access to GitHub.
 
  
===Selecting the Git or GitHub Software===
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof10|Keyboard Quick Reference Card]]>>>
  
FreeCAD uses the GitHub servers, there are two options to interact with them:
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof11|Proposed revision of Wiki Tutorial Page - Phase I]]>>>
 
+
* <<<DRAFT status edits for a page on [[Sandbox:Piffpoof11a|Proposed revision of Wiki Tutorial Page - Phase II]]>>>
* GitHub offers 2 desktop apps which have GUI interfaces:
 
** [https://mac.github.com/ GitHub on Mac]
 
** [https://windows.github.com/ GitHub on Windows]
 
**there doesn't appear to be one for Ubuntu and Fedora but there are a number of [http://git-scm.com/download/gui/linux 3rd party GUIs for Git]
 
* the Git protocol which is a command line mode interface
 
 
 
This page will only document the command line mode interface as the GUI apps come with their own documentation and are specific to the platform.
 
 
 
===Installing the Git Software===
 
 
 
Expand the topic box below that matches your computing platform:
 
 
 
<div class="mw-collapsible mw-collapsed toccolours">
 
 
 
===Macintosh Installation===
 
<div class="mw-collapsible-content">
 
 
 
# go to Source Forge and download the .DMG file
 
# Create a folder that will hold the Git install image and later the Git repositories.
 
# Double-click the DMG file (which will be in the Downloads folder), Once it is mounted open it in a Finder window and copy the contents to the folder you created.
 
# Double-click the package (ends in .PKG) to install Git. This will install git to /usr/local/git. Root access is required so it will ask for an administrator account and password.
 
 
 
Git should now be installed and operational. You can now start using it as described in the next section. If  you want to check it simply type <code>'''git'''</code> in the Terminal application and the system will list the Git summary of commands.
 
</div>
 
</div>
 
 
 
 
 
<div class="mw-collapsible mw-collapsed toccolours">
 
 
 
===Ubuntu & Fedora Installation===
 
<div class="mw-collapsible-content">
 
{{VeryImportantMessage|'''This needs to be written'''}}
 
</div>
 
</div>
 
 
 
 
 
<div class="mw-collapsible mw-collapsed toccolours">
 
===Windows Installation===
 
<div class="mw-collapsible-content">
 
{{VeryImportantMessage|'''This needs to be written'''}}
 
</div>
 
</div>
 
 
 
==Using Git and GitHub With Files==
 
 
 
The greater number of users will be simply getting files from the GitHub repository, the lesser number will be creating, modifying and updating files. The first subsection covers what will be the most frequent operation, which is getting a file (or files) from the GitHub repository. The subsequent subsections cover creating, modifying and updating files on the GitHub repository.
 
 
 
===Getting (Pulling) a File From the GitHub Repository===
 
 
 
<to be filled in>
 
 
 
'''Note''': For all the following processes you must go to the GitHub home page and sign in before you can use GitHub
 
 
 
===Create a New Repository on GitHub as outlined [https://help.github.com/articles/creating-a-new-repository/ here]===
 
# click on the plus sign ("+") on any page
 
# give your repository a name
 
# a description always helps
 
# set your repository as public/private<br>'''Note''': if you are on the free (i.e. pay no money plan) then you can only create a Public repository
 
# '''do not''' check the box or select the 2 menus to create any of the optional items (e.g. README, license, .gitignore) as they may conflict later cause a conflict
 
# click Create Repository
 
# leave this webpage open as it will be needed in the next step
 
 
 
===Upload Your Files to Your Newly Created Repository (Pushing) as outlined [https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/ here]===
 
# open up the Terminal application
 
# change your working directory to the folder holding your file:<br><code>'''cd ~/Desktop/myFirstRepository'''</code>
 
# intialise the directory as a local Git repository:<br><code>'''git init'''</code>
 
# add the files in your new (on disk)  repository<br><code>'''git add .'''</code><br>notice that there is a space and a period fallowing the command
 
# now commit them to the GitHub repository with a descriptive comment:<br><code>'''git commit -m 'First commit of my files to my repository''''</code><br>your files are now copied to the GitHub repository and put under version control.
 
# return to the webpage from the previous step, click on the icon to copy the URL of your repository on the GitHub server, the URL will be of the form:<br><code><nowiki>https://github.com/yourUserID/myFirstRepository.git</nowiki></code><br>you can also copy this URL by normal means
 
# in the Terminal application enter:<br><code>'''git remote add origin <nowiki>https://github.com/yourUserID/myFirstRepository.git</nowiki>'''</code><br>which will designate the central version of the repository on the GitHub server as the master copy (i.e. the origin)
 
# still in the Terminal enter:<br><code>'''git push origin master'''</code><br>this will copy the changes from your local on-disk repository to the central master copy located on the GitHub server. You will be asked for your GitHub User ID and password.
 
 
 
Your new repository is now fully created on the GitHub server.
 
 
 
===Adding Files to the Repository (Pushing)===
 
# move or copy the new files that you wish to add to the Git repository directory on your local disk: (~/Desktop/myFirstRepository in the example above)
 
# in the Terminal application set your working directory the local repository:<br><code>'''cd ~/Desktop/myFirstRepository'''</code>
 
# enter:<br><code>'''git add yourNewFile1.jpg<br>git add yourNewFile2.txt'''</code><br> this will add the 2 files to your local Git repository
 
# as with the previous example, now commit them to the GitHub repository with a descriptive comment<br><code>'''git commit -m 'adding 2 new files to fill in the gaps''''</code><br>your files are now copied to the GitHub repository and put under version control.
 
#and finally copy the files from your local repository to the central one:<br><code>'''git push --set-upstream origin master
 
'''</code>
 
 
 
Your 2 new files are now both in your local repository as well as propagated to the central repository on GitHub
 
 
 
===Making Changes to Files in the Repository (Forking)===
 
#
 
===Miscellaneous Commands===
 
* git config
 
* git help
 
* git status
 
* git branch
 
* git checkout
 
* git merge
 
* git pull
 
 
 
==Using Git and GitHub to Build FreeCAD ==
 
 
 
* [[Source_code_management]]
 

Latest revision as of 11:00, 20 February 2016

Sandbox Page for "Piffpoof"


This holds (or points to) things of a transient nature being worked on by Piffpoof.

  • <<<DRAFT status edits for a page on Groups>>>


All the following tutorials use Example Files on GitHub: