Git Quick-Start Guide

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 Home  |  Articles & FAQs  |  Bugs & Features  |  Documentation  |  Download  |  Screenshots  ]
 

Last Updated 23 Jul 2022

The following is a quick guide to using Git to maintain the FLTK code.

Contents

Git for Subversion Users

If you are familiar with the Subversion software, you will find that Git is very similar. You'll use the git command instead of svn, and if you set your SVN_EDITOR environment variable, just set the core.editor Git configuration variable to the same thing. The following table maps Subversion commands to Git:

Subversion Command Git Command
 svn co repos fltk 
 git clone repos fltk 
 svn update 
 git pull 
 svn add name 
 git add name 
 svn remove name 
 git rm name 
 svn move name newname 
 git mv name newname 
 svn commit 
 git commit ; git push 
 svn diff 
 git diff 
 svn blame 
 git blame 
 svn co repos/branches/foo fltk
 svn co repos/releases/foo fltk 
 git clone repos fltk
 + git checkout foo 
 git switch repos/branches/foo
 git switch repos/releases/foo 
 git clone repos
 + git checkout foo 
 svn copy repos/releases/foo 
 git tag [-a] releases/foo 
 svn copy repos/branches/foo 
 git branch foo 

where repos =

  • http://seriss.com/public/fltk/fltk for Subversion (discontinued).
  • https://github.com/fltk/fltk.git for Git.

Git Software

To download source code from the Git server you will need the Git software for your system. Most Linux distributions include Git, and Xcode 5 and higher supports Git on macOS. The Git software can be found at the following sites:

https://git-scm.com/
https://github.com/git/git

Retrieving Software From the Git Server

To retrieve, or check out, the FLTK software, use one of the following commands:

FLTK 1.0.x, 1.1.x, 1.3.x, 1.4.x:

git clone https://github.com/fltk/fltk.git fltk ENTER

FLTK 1.2, 2.0, 3.0 (dormant, no longer in development):

git clone https://github.com/fltk/fltk-legacy.git fltk-legacy ENTER

Updating the Software

To update your local copy of the source code, run the following command:

git pull ENTER

Adding, Moving, and Removing Files

Note: All of these commands act on your local copy of the files. Your changes will not be saved on the server until you commit and push them.

To add a file, run the following command:

git add filename ENTER

To move a file, run the following command:

git mv filename newfilename ENTER

To remove a file, run the following command:

git rm filename ENTER

Adding a new directory:

mkdir examples ENTER
cp foo.cxx examples/ ENTER
cp bar.cxx examples/ ENTER
git add examples ENTER

Don't forget to commit and push your changes when you are done.

Checking Your Changes In

To commit your changes to your local copy of the Git repository, run the following command:

git commit ENTER

Don't forget to push your changes to the server for everyone to see.

Pushing Your Changes to the Server

To push your changes to the server for everyone to see, run the following command:

git push ENTER

Creating Patch Files

To prepare a patch file for submission to the FLTK team, run the following command:

git diff >filename.patch ENTER

Miscellaneous Administration Commands

To list all the tags for fltk:

git tag ENTER

To get the revision info (SHA1) for a specific fltk release (tag), for instance 1.3.0:

git rev-parse [ --short=N ] release-1.3.0 ENTER
The optional commandline flag --short=N can be used to abbreviate the SHA1 to N characters.

To get the full revision info (log) for a specific fltk release, for instance 1.3.0:

git log -2 release-1.3.0 ENTER
This prints two log entries. Depending on the kind of tag used to tag the release this will be either the (annotated) tag and the latest commit or the two latest commits before the release (simple tag).

To see the changes in a specific revision:

git show release-1.3.4~5 ENTER
displays the fifth commit before release-1.3.4

To rename a file:

git mv old.cxx new.cxx ENTER

To revert a rename (before being committed):

git mv new.cxx old.cxx ENTER
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.