H2 Contribute Redux · Part 2: Git basics

This commit is contained in:
Fede.- 2021-10-27 01:18:44 -03:00
parent a6a71b54bc
commit 80fd3ce950
42 changed files with 77 additions and 46 deletions

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 287 KiB

After

Width:  |  Height:  |  Size: 287 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 537 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 531 KiB

View File

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -0,0 +1,69 @@
---
title: "Preparing the workspace: Git basics"
published: true
visible: true
updated:
last_modified: "October 2021"
app: Git
app_version: 2.33.0
taxonomy:
category:
- docs
tags:
- contribute
- git
page-toc:
active: true
---
# Git basics
The aim of the following tutorials is to introduce you to the basics of **Git**, the main tool we use to manage the **Howto** project files. Therefore, we will not cover all the aspects of its usage, only some basic concepts and commands.<br>
If you get more interested about **Git**, there are lots of in-depth tutorials and documentation written about it that you can easily find on the internet.
## What does Git do?
![](en/git.png)
When you read a **Disroot** tutorial, what you are seeing is the representation in your browser of a piece of code, in our case, a text file written in a formatting syntax called **Markdown**. The entire code of this site and its content is hosted in a **git repository**, a folder containing all the project files and the changes history of each and every one of those files (what has changed, who has changed it and why it has changed).
In this repository (or repo) there is a **main branch** (or "master branch"), the default project folder where is the "final" code, the one is online.
When a tutorial needs to be modified (e.g., some software has been updated, typos were found in a document, there is information to be added/removed, etc) what we do is copy the remote repository into our machine, this way we can work locally on the files. This procedure is called **cloning** and once it is done, all Git operations are managed from our local repository.
Next step is to create a new **branch**, a fork of the main branch on which we can make modifications without compromising the original code.
![](en/git_branches.png)
[//]: # (TODO)
## Setting your username and email
In order to be able to send your work from your machine to the remote repository, it is necessary to setup your **Gitea** username and email.
1. Open a terminal and start Git<br>
`git init`<br>
2. Type and complete with your information the following commands:<br>
`git config --global user.email user@email`<br>
`git config --global user.name "User Name"`
## Cloning the **Howto Disroot** repository
Git is designed with collaboration in it's core. So, first thing we need to do is get a copy of all files within the project onto our local hard drive. This process is called "*cloning a repository*". All modifications are done on our local machine (most of the work is made offline). Once we've decided that the changes (new tutorial, translation) are finished we can sent/sync them back to the repository on the server (*push*).
To clone the repository just open a terminal, navigate to the directory you would like to clone the repository to, and run `git clone <url>` command, where *<url>* is basically the address of the repository you want to clone. In our case it would be:
`git clone https://git.disroot.org/disroot/howto`
Once the repository is copied to your hard drive you will see a `howto` directory that consists of all the files you could previously browse in your web browser when on our repository's url.
You can later move that directory to any place you want on your computer.
### Access to the repository
In order to be able to commit changes to **Disroot**'s git repository, you need to request access. This is done via [our git project page](https://git.disroot.org/disroot/howto)
![](en/git-request_access.png)
Once admins grant you the access, you can "*push*" your changes to the server.
!! ![](/home.icons/note.png)
!! NOTE: You can start working without access granted as all the changes happen on your local computer.

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 42 KiB

View File

@ -1,11 +1,11 @@
---
title: How-to Contribute: Git Basics
title: "Working with Git"
published: true
visible: false
visible: true
updated:
last_modified: "22 August 2019"
app: Git and Atom
app_version: 1.40
last_modified: "October 2021"
app: Git
app_version: 2.33.0
taxonomy:
category:
- docs
@ -16,45 +16,6 @@ page-toc:
active: true
---
# Git Basics
We'll not cover all the aspects of using git in this tutorial. There are lots of in-depth tutorials and books written about this tool and what we're aiming at is providing a short and easy way to contribute to tutorials and translations.
# Before starting the work
## Installing git
Since all the modifications will happen on your local machine, you need to [install git](https://gist.github.com/derhuerst/1b15ff4652a867391f03) to be able to send your changes as well as sync changes of others. Depending on your platform the ways to install git may vary so check the link above or refer to your platform specific documentation.
## Installing Atom editor
If you haven't yet, it's time to install [Atom](https://atom.io). **Atom** is a feature rich text editor with special git integration. If your Operating system is not automatically detected or listed when going to [Atom](https://atom.io) website, check [Other platforms](https://github.com/atom/atom/releases/latest). For all Arch users, you can simply install it using `pacman -S atom` or other package manager of your choice.
## Create an account on git instance
After installing **git** and **Atom**, you'll need an account on **Disroot** git instance. As of late we fortunately host our own **gitea** instance, but you'll have to register an account separately. Your **Disroot** account doesn't apply here. For a better assignment we suggest to use the same username as on **Disroot**.
To create an account just go to [https://git.disroot.org](https://git.disroot.org) and register.
## Preparing the workspace
Git is designed with collaboration in it's core. So, first thing we need to do is get a copy of all files within the project onto our local hard drive. This process is called "*cloning a repository*". All modifications are done on our local machine (most of the work is made offline). Once we've decided that the changes (new tutorial, translation) are finished we can sent/sync them back to the repository on the server (*push*).
### Cloning the **Howto Disroot** repository
To clone the repository just open a terminal, navigate to the directory you would like to clone the repository to, and run `git clone <url>` command, where *<url>* is basically the address of the repository you want to clone. In our case it would be:
`git clone https://git.disroot.org/disroot/howto`
Once the repository is copied to your hard drive you will see a `howto` directory that consists of all the files you could previously browse in your web browser when on our repository's url.
You can later move that directory to any place you want on your computer.
### Access to the repository
In order to be able to commit changes to **Disroot**'s git repository, you need to request access. This is done via [our git project page](https://git.disroot.org/disroot/howto)
![](en/git-request_access.png)
Once admins grant you the access, you can "*push*" your changes to the server.
!! ![](/home.icons/note.png)
!! NOTE: You can start working without access granted as all the changes happen on your local computer.
# Starting to work
Now you can start **Atom**.

View File

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 30 KiB

View File

Before

Width:  |  Height:  |  Size: 37 KiB

After

Width:  |  Height:  |  Size: 37 KiB

View File

Before

Width:  |  Height:  |  Size: 98 KiB

After

Width:  |  Height:  |  Size: 98 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

View File

Before

Width:  |  Height:  |  Size: 34 KiB

After

Width:  |  Height:  |  Size: 34 KiB

View File

Before

Width:  |  Height:  |  Size: 51 KiB

After

Width:  |  Height:  |  Size: 51 KiB

View File

Before

Width:  |  Height:  |  Size: 287 KiB

After

Width:  |  Height:  |  Size: 287 KiB

View File

Before

Width:  |  Height:  |  Size: 2.6 MiB

After

Width:  |  Height:  |  Size: 2.6 MiB

View File

Before

Width:  |  Height:  |  Size: 537 KiB

After

Width:  |  Height:  |  Size: 537 KiB

View File

Before

Width:  |  Height:  |  Size: 38 KiB

After

Width:  |  Height:  |  Size: 38 KiB

View File

Before

Width:  |  Height:  |  Size: 531 KiB

After

Width:  |  Height:  |  Size: 531 KiB

View File

Before

Width:  |  Height:  |  Size: 259 KiB

After

Width:  |  Height:  |  Size: 259 KiB

View File

Before

Width:  |  Height:  |  Size: 1.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

Before

Width:  |  Height:  |  Size: 6.5 KiB

After

Width:  |  Height:  |  Size: 6.5 KiB

View File

@ -46,7 +46,7 @@ Sounds pretty easy, doesn't it? Well, it really is. Of course, every step of the
**Kate Editor**: [Download](https://kate-editor.org/) · [Source code](https://invent.kde.org/utilities/kate) | **Atom Text Editor**: [Download](https://atom.io/) · [Source code](https://github.com/atom/atom)
3. **A Disroot Gitea account**: In order to be able to submit your work, you will need to register an account on our **Gitea** instance (**Disroot** credentials will not work).
3. **A Disroot Gitea account**: In order to be able to submit your work, you will need to register an account on our **Gitea** instance (**Disroot** credentials will not work) and request access to our repository.
[**Register a new account**](https://git.disroot.org/user/sign_up) on **Disroot's Gitea** instance.

View File

@ -16,9 +16,10 @@ page-toc:
![](contribute.jpg)
We think that knowledge is a collective construction: the result of working together and cooperatively, as a community. And whether the contributions take the form of a financial contribution, writing or translating a tutorial, or reporting bugs, they are all essentially personal time devoted to others. A bit like love.
We think that knowledge is a collective construction: the result of working together and cooperatively, as a community. And whether the contributions take the form of a donation, writing/translating a tutorial or reporting bugs, they are all essentially personal time devoted to others. A bit like love.
So, for those of you who may want to contribute by donating your time and knowhow, we have tried to channel all the efforts through this section.
Here you'll find basic information and guidelines for different ways to contribute, from feedback to write a how-to or translate them to your language.
---