kemonine
/
lollipopcloud
Archived
1
0
Fork 0
This repository has been archived on 2022-08-05. You can view files and clone it, but cannot push or open issues or pull requests.
lollipopcloud/how-to-gitea.md

4.7 KiB

Gitea cheat sheet for beginners and the forgetful

Below is the basic Gitea workflow, to help you with your contributions. But do not hesitate to reach out to any of the organizers for help! We're happy to walk you through any or all of this, no matter what your experience level. If you've never even heard of Gitea before, we'd love to help you submit your first contribution!

If you want to delve even deeper into Git (perhaps because you are a glutton for punishment), there is a ton of information in this Git Book (link).

Basic Steps For Contributing

These are the general steps, but if you need more information, keep reading below.

  • Fork the repository (just once!) from Lollipop Cloud project page (link)
  • Clone your fork on your own computer
  • Edit, make changes and contributions
  • Push those changes to your fork
  • Open a merge/pull request in Gitea
  • Wait for project coordinator to provide feedback or approve the merge/pull request

What to do if you've never done this before...

Log in to Gitea

If you haven't already, create an account on the Lollipop Cloud project page (link) and log in.

Fork it! (copy the project to your Gitea account)

View the repository you would like to work on (code, docs, website), and click Fork in the upper right corner. You will only have to fork once!

A fork is an exact copy of the project as it existed at the exact moment you forked it. So when the project updates in the future, you will have to update your code too, but we will talk about that later.

At this point, you will need a command line client like PuTTY (link) for Windows users, or the built-in Terminal for MacOS users.

Create a directory (an empty folder) for where you'd like your copy of the project to live, and open it.

In PuTTY or Terminal, enter each of the following commands, where "lollipop_project" is the name of directory where you would like to store the clone.

mkdir /path/to/lollipop_project

cd /path/to/lollipop_project

CLONE (create a local copy) of the project files

View your newly created fork in your web browser and copy the https:// address in the box on the right side of the page. In your terminal program, enter git clone https://git.lollipop.holdmybeer.solutions/your-username/forked-repository, with the correct URL. You are downloading all the project files to your computer! Yay!

View your cloned project

Git will install the project in a new folder. Use the command ls to see the name of the new project folder if you are unsure. Open this new folder with cd cloned_directory_name

Edit your contributions!

Now that the files live locally on your computer, you can edit them with your favorite editor. Stick with the command line (Vim, Emacs, Nano), or use a text editor like Atom (link).

Commit your changes

When you're ready, go back to the command line and commit your changes with a short but descriptive comment. git commit -m "Updated List of Anthropomorphic Potatoes"

Push your changes to your fork

When you're really ready, "push" those changes to the original source, which is a request to accept and merge your contributions with the rest of the project. A push request and a merge request are the same thing. git push origin master

Create a pull request (AKA merge request)

Go back to your browser and your forked repository https://git.lollipop.holdmybeer.solutions/your-username/forked-repository and go to Pull Requests and choose New Pull Request. [this step gets muddy and needs clarification.]

What to do when "upstream" changes...

"Upstream" is the name of the original code (not your fork). When it gets updated after you clone or fork, you will have to request a copy of those changes to stay up-to-date.

Add the upstream path (Do this step only once!)

If the master (where you forked FROM) changes, you will have to update your local clone. You will only have to do this step ONE time!

From your /path/to/lollipop_project/new_clone_directory/ directory,

Do this: git remote add upstream https://git.project-domain.com/forked_from/original_repository.git with the original repository URL.

Fetch the changes since you first forked or last fetched changes

In order to be sure you're working off the latest copy of the project, you can fetch the latest changes with git fetch upstream

Now you have the latest copy of the project in your local directory. Your new changes from this point forward will be stored in a local branch called upstream/master.

Make your edits!

Merge your changes with the upstream repo (the original repo that you forked).

git merge upstream/master