Overview
Forgejo is an open source, web-based Git service that resembles GitHub. The Computer Science department operates its own Forgejo service that faculty use to collect, grade, and manage some classroom assignments. This document provides a brief overview of how to use the CS Department's Forgejo service.
Forgejo Site
You can find our Forgejo service at https://git.cs.uwlax.edu/. You must access this site from a campus IP address. If you are off-campus, then you must use the campus VPN to access this site.
Sign In
Sign in to Forgejo using your UWL NetID and password.
Create a Project
A Git repository holds the files that make up a project. You will find a button (‘+’) at the upper right portion of the Forgejo homepage that allows you to create a “New repository”.
Pressing the new repository button will present a page that allows you to set a number of settings for your new repository. Most important is the repository name, whether the repository will be public or private, and the repository description. Consult with your instructor or advisor if you are unsure about how to name your repository or whether it should be public. Once you fill in your project's settings press “Create repository”. This will display the page associated with your new repository.
Working with a Project
Git provides many operations, but the most essential are clone, add, commit, and push. With these operations, you can make a local copy of a repository, make changes to the repository, and publish back to the repository. You can carry out these operations using the command line, an IDE, or another tool. These instructions will cover using the command line.
Clone
Cloning make a copy of a repository. Each repository page in Forgejo displays the URL you can use to clone the repository. You will and to use the SSH form of the repository, which will look something like ssh://forgejo@git.cs.uwlax.edu/NETID/REPOSITORY-NAME.git. Running the following command will clone this repository, placing a copy of it on your computer in your current working directory:
git clone ssh://forgejo@git.cs.uwlax.edu/NETID/REPOSITORY-NAME.git
Now you can cd into the directory REPOSITORY-NAME and begin your work. For example, you might use a text editor to create a Java source file named Hello.java.
Add and Commit
Let's assume you want to publish a file you created named Hello.java. This is a two-step process. First, run git add Hello.java to indicate to Git that you want the tool to track the file you created. Next, run git commit -s -m "Created Hello.java" to stage you commit. The text Created Hello.java is a human-readable log message; you should select a message for each commit that describes the activity in the commit. Once you have added and committed a bit of work, you can optionally view the record of your commits by running git log.
Push
Your local commit is not yest published back to your Forgejo repository. Publishing your local commits back to Forgejo is a matter of running git push. Once you have pushed, you should be able to return to Forgejo to view you commit there. Forgejo should now be synchronized with your local work.