Menu

git

Roger B. Dannenberg Nolan Hergert Chet Gnegy

Home

Using git

git is a system for managing source code. Our project code is on SourceForge in a repository or repo. You will clone the current repo on SourceForge, putting the copy on your local machine. (You can have as many clones on as many machines as you like.)

You will work with your local copy of the code. When you get to a point where you want to share code with others, you will commit the code from your local working copy into your local git repo. Then, you will push your changes from your local repo to the one on SourceForge.

When you want to update your code to incorporate the changes others have pushed to SourceForge, you will pull the code to your local repo.

git has many features and operations, including backing out changes, viewing changes, etc. This page just tells you how to get started and perform commit, push, and pull operations.

Getting Started: Cloning the SourceForge Repository

0.5. Install E-Git by going opening Eclipse, then going to Help->Install New Software, and use the URI of http://download.eclipse.org/egit/updates

  1. (This first step sets up ssh to talk to git.code.sf.net. Without this, Eclipse will fail when it tries to use ssh to talk to SourceForge.) On the command line, type: ssh git.code.sf.net
  2. ssh prints...

    The authenticity of ... can't be established.
    RSA key fingerprint is ...
    Are you sure you want to continue connection (yet/no)?
  3. type yes
  4. ssh prints...

    Warning: Permanently added 'git.code.sf.net ...
    fatal: Interactive git shell is not enabled
    hint: ...
    Connection to git.code.sf.net closed.
  5. (If you cannot run ssh from your command line, you may have to install ssh. If you have ssh -- probably you do -- you may be able to accomplish the same thing with a graphical application such as PuTTY. It will not hurt to try connecting via ssh more than once.)
  6. Open Eclipse
    • File:Import...
    • select Git/Projects from Git
    • push "Clone..." button
    • a dialog box will open
  7. In the dialog window:
    • Enter the URI: git+ssh://rbd@git.code.sf.net/p/floctrl/code. In place of rbd, use your SourceForge ID.
    • User: your SourceForge user id
    • Password: your SourceForge password
    • Store in Secure Store (select this option)
    • click Next>
  8. Should see "master" with a checked box, click Next>
  9. Local Destination: change Directory: to where you want the project code, and click Finish>
  10. Select Import Existing Projects
    • in the Import Projects window, leave everything checked
    • click Finish
  11. Click on the Workbench button. A number of projects should be ready for work.
  12. The next time you open the workspace, you'll be set to go, so all of these steps are needed only once.

Getting the Audio Sample Repo:

In eclipse, import a new project -> projects from git->Clone...
To access the sample repo, use the URL:
ssh://YOURUSERNAME@floctrl.git.sourceforge.net/gitroot/floctrl/sound
enter your user and password
When prompted for the location of the sound directory, make sure you put it in the same place as the code directory that you installed already (see instructions above).

Using git to distribute changes

  1. Right-Click (or Ctrl-Click) on FloCtrl in Package Explorer window (on left)
  2. Select Team:Commit... to get Commit Changes to Git Repository window
  3. Type a commit message in the box -- try to give high-level rationale rather than low-level details, which we can find automatically with diff
  4. Click Commit -- this only puts the changes in your local repository
  5. Right-Click (or Ctrl-Click) on FloCtrl in Package Explorer window (on left)
  6. Select Team:Push to Upstream, get confirmation, click OK

Using git to download others' changes

  1. Right-Click (or Ctrl-Click) on FloCtrl in Package Explorer window (on left)
  2. Select Team:Pull, get confirmation, click OK
  3. Optional: Right-Click, Compare With:Previous Revision will open a tab in Eclipse where you can see side-by-side comparisons of file versions

Related

Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.