Merge branch 'resolve-merge-conflict'

This commit is contained in:
Lucas Hinderberger 2020-10-16 17:36:13 +02:00
commit a20230f555
15 changed files with 81 additions and 80 deletions

View file

@ -5,9 +5,9 @@ eleventyNavigation:
parent: AdvancedUsage parent: AdvancedUsage
--- ---
## Upload images via git ## Uploading images via git
Currently, gitea supports only images in the base directory of the wiki git. (Gitea wiki pages are stored in a separate wiki right beside the project, wiki pages themselves are markdown files). Currently, Gitea supports only images in the base directory of the wiki git. (Gitea wiki pages are stored in a separate wiki right beside the project, wiki pages themselves are markdown files).
A feasible workflow might look like this (replace `<user>` and `<project>` with your user and project name): A feasible workflow might look like this (replace `<user>` and `<project>` with your user and project name):
@ -20,7 +20,7 @@ git commit -m "add image"
git push git push
``` ```
Now, you can reference the image in markdown, like this: Now, you can reference the image in Markdown, like this:
```markdown ```markdown
![image alt text](codeberg.png "image title") ![image alt text](codeberg.png "image title")

View file

@ -19,7 +19,7 @@ Although it is perfectly possible to use a Git project on Codeberg just as singl
Let's say, you would like to contribute to project [Codeberg/build-deploy-gitea](https://codeberg.org/Codeberg/build-deploy-gitea). Let's say, you would like to contribute to project [Codeberg/build-deploy-gitea](https://codeberg.org/Codeberg/build-deploy-gitea).
First, fork the project you would like to work on, by clicking the `fork` button on the top-right corner of the project page: First, fork the project you would like to work on, by clicking the `fork` button in the top-right corner of the project page:
![Fork a project](/assets/images/collaborating/pull-requests-and-git-flow/fork-button.png) ![Fork a project](/assets/images/collaborating/pull-requests-and-git-flow/fork-button.png)

View file

@ -16,12 +16,12 @@ We are hosted in Germany by Hetzner Online GmbH.
There is no fixed limit, but use cases that harm other users and projects due to excessive resource impact will get restricted. Please refer to our [terms of service](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md#repositories-wikis-and-issue-trackers). There is no fixed limit, but use cases that harm other users and projects due to excessive resource impact will get restricted. Please refer to our [terms of service](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md#repositories-wikis-and-issue-trackers).
## What is the size limit for my avatar? ## What is the size limit for my avatar?
You can upload avatar pictures of upto 1 megabyte and 1024x1024 resolution. You can upload avatar pictures of up to 1 megabyte and 1024x1024 resolution.
## Is Codeberg open-source? ## Is Codeberg open-source?
Codeberg is built on [Gitea](https://github.com/go-gitea/gitea), which is open-source. We make all of our changes and other code available under the [Codeberg organization](https://codeberg.org/Codeberg). Codeberg is built on [Gitea](https://github.com/go-gitea/gitea), which is open-source. We make all of our changes and other code available under the [Codeberg organization](https://codeberg.org/Codeberg).
## What version of Gitea are you running? ## What version of Gitea are you running?
You can check the version of Gitea Codeberg uses through the [API here](https://codeberg.org/api/v1/version). You can check the version of Gitea Codeberg uses through the [API here](https://codeberg.org/api/v1/version).
You will get a reponse like this: `{"version":"1.12.3+20-gb49f2abc5"}`. Here, 1.12.3 is the Gitea version number, and 20 is the number of patches applied on top of the release (which for example includes upstream commits and patches by Codeberg), with b49f2abc5 being the commit ID of the last patch applied on [the Codeberg branch](https://codeberg.org/Codeberg/gitea/commits/branch/codeberg) of Codeberg's Gitea repository. Note that the commit ID is without the leading "g". You will get a response like this: `{"version":"1.12.3+20-gb49f2abc5"}`. Here, 1.12.3 is the Gitea version number, and 20 is the number of patches applied on top of the release (which for example includes upstream commits and patches by Codeberg), with b49f2abc5 being the commit ID of the last patch applied on [the Codeberg branch](https://codeberg.org/Codeberg/gitea/commits/branch/codeberg) of Codeberg's Gitea repository. Note that the commit ID is without the leading "g".

View file

@ -6,16 +6,16 @@ eleventyNavigation:
order: 30 order: 30
--- ---
Almost everything you can do on Codeberg starts in a repository. Think of a repository as a home for your project, where all of its sourcecode can be organized using Git and which also contains optional features like an issue tracker and wiki. Almost everything you can do on Codeberg starts in a repository. Think of a repository as a home for your project, where all of its source code can be organized using Git and which also contains optional features like an issue tracker and wiki.
This article will lead you through creating your first repository on Codeberg, connecting your local development environment and making your first sourcecode commit. This article will lead you through creating your first repository on Codeberg, connecting your local development environment and making your first source code commit.
## Creating a Repository ## Creating a Repository
> A note to more advanced users: It is currently not possible to use Push-to-Create to push a fresh repository onto Codeberg. > A note to more advanced users: It is currently not possible to use Push-to-Create to push a fresh repository onto Codeberg.
To create a new repository, you need be logged in to your account on Codeberg.org. To create a new repository, you need be logged in to your account on Codeberg.org.
After login you can use one of the two buttons shown in the two following screenshots to create a new repository: After login, you can use one of the two buttons shown in the two following screenshots to create a new repository:
<picture> <picture>
<source srcset="/assets/images/getting-started/first-repository/create-repo.webp" type="image/webp"> <source srcset="/assets/images/getting-started/first-repository/create-repo.webp" type="image/webp">
@ -123,7 +123,7 @@ LICENSE README.md
If you already have written source code that you now would like to upload to Codeberg, follow these steps: If you already have written source code that you now would like to upload to Codeberg, follow these steps:
#### 1. Initialize a Git Repository #### 1. Initialize a Git Repository
Do this first, unless you already have a Git Repository initializied in your local source tree: Do this first, unless you already have a Git Repository initialized in your local source tree:
```bash ```bash
knut@iceberg:~/my-project$ git init knut@iceberg:~/my-project$ git init
@ -131,7 +131,7 @@ Initialized empty Git repository in /home/knut/my-project/.git/
``` ```
#### 2. Add Codeberg as the repository's origin #### 2. Add Codeberg as the repository's origin
Now, you need to tell Git where to push your changes to. You do that by specifying Codeberg as a remote. Now, you need to tell Git where to push your changes. You do that by specifying Codeberg as a remote.
> In this example, we'll specify Codeberg as the `origin` remote. You can name your remote any other way, especially if you already have an `origin`, but `origin` is the recommended name for the main remote repository. > In this example, we'll specify Codeberg as the `origin` remote. You can name your remote any other way, especially if you already have an `origin`, but `origin` is the recommended name for the main remote repository.
@ -152,7 +152,7 @@ Now that you've connected your repository to your local development copy, it is
Let's modify the auto-generated `README.md` file. Let's modify the auto-generated `README.md` file.
> If you haven't auto-generated `README.md`, the following commands will still work fine, but create a new file containing only `Hello World!` instead > If you haven't auto-generated `README.md`, the following commands will still work fine, but create a new file containing only `Hello World!` instead
```bash ```bash
knut@iceberg:~/repositories/foobar$ echo "Hello World!" >> README.md knut@iceberg:~/repositories/foobar$ echo "Hello World!" >> README.md
knut@iceberg:~/repositories/foobar$ cat README.md knut@iceberg:~/repositories/foobar$ cat README.md
@ -225,7 +225,7 @@ If you're happy with the changes you made, the next step is to present them to t
```bash ```bash
knut@iceberg:~/repositories/foobar$ git push -u origin main knut@iceberg:~/repositories/foobar$ git push -u origin main
Username for 'https://codeberg.org': knut Username for 'https://codeberg.org': knut
Password for 'https://knut@codeberg.org': Password for 'https://knut@codeberg.org':
Enumerating objects: 5, done. Enumerating objects: 5, done.
Counting objects: 100% (5/5), done. Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads Delta compression using up to 16 threads

View file

@ -12,18 +12,18 @@ and click on "Register" to bring up the registration form.
There, simply fill in your username and email address and then choose a good password. There, simply fill in your username and email address and then choose a good password.
After confirming your email address by clicking the link that we sent you to your After confirming your email address by clicking the link that we sent you to your
email account, you're done and good to go! email account, you're done and good to go!
## Community ## Community
Codeberg is a non-profit volunteer effort. It relies on its friendly and dedicated community. We're happy that you're now a part of our community, too, and we hope you're feeling welcome! Codeberg is a non-profit volunteer effort. It relies on its friendly and dedicated community. We're happy that you're now a part of our community, too, and we hope you're feeling welcome!
We kindly ask you to be polite and civil when on Codeberg and to not excessively use the resources provided. Please see our [Terms of Use](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md) for details. We kindly ask you to be polite and civil when on Codeberg and to not excessively use the resources provided. Please see our [Terms of Use](https://codeberg.org/codeberg/org/src/branch/master/TermsOfUse.md) for details.
Please remember that everyone here is contributing on their free time, as volunteers. Please remember that everyone here is contributing on their free time, as volunteers.
If you like a project on Codeberg, consider **giving it a star** and/or **following its author**. That helps building and growing a network of free software projects and people and can serve as guidance for users exploring Codeberg, looking for interesting projects to try out or contribute to. If you like a project on Codeberg, consider **giving it a star** and/or **following its author**. That helps with building and growing a network of free software projects and people and can serve as guidance for users exploring Codeberg, looking for interesting projects to try out or contribute to.
## Orienting yourself on Codeberg ## Orienting yourself on Codeberg
@ -37,7 +37,7 @@ After successfully registering on Codeberg, you should see this screen:
An explanation of the highlighted elements above: An explanation of the highlighted elements above:
- **Dashboard (1)** is the screen you're looking at right now. It gives you an overview of the newest activity - **Dashboard (1)** is the screen you're looking at right now. It gives you an overview of the newest activity
of you, the people you follow and in your or your organization's projects. by you, the people you follow and in your or your organization's projects.
- **Issues (2)** and **Pull Requests (3)** These are overviews of issues and pull requests that you are either involved in or that are part of one of the organizations you belong to. - **Issues (2)** and **Pull Requests (3)** These are overviews of issues and pull requests that you are either involved in or that are part of one of the organizations you belong to.
- **Codeberg Issues (4)** This is currently the primary communication channel for the Codeberg Community. Here, you can ask questions, report bugs and suggest changes to Codeberg. You're also welcome to browse these issues and contribute your solutions, if you want to support Codeberg even more. - **Codeberg Issues (4)** This is currently the primary communication channel for the Codeberg Community. Here, you can ask questions, report bugs and suggest changes to Codeberg. You're also welcome to browse these issues and contribute your solutions, if you want to support Codeberg even more.
- **The Create Menu (5)** You can create repositories, organizations and migrations using this menu. It's your entry point to kicking off entirely new things on Codeberg. - **The Create Menu (5)** You can create repositories, organizations and migrations using this menu. It's your entry point to kicking off entirely new things on Codeberg.
@ -48,7 +48,7 @@ An explanation of the highlighted elements above:
## A word about Security ## A word about Security
While it is important to choose a strong password, it is also While it is important to choose a strong password, it is also
important to use Two-factor Authentication in case your password or device important to use Two-factor Authentication in case your password or device
ever gets compromised, so that should be one of the first things to ever gets compromised, so that should be one of the first things to
configure after you have created your account. configure after you have created your account.
We recommend that you use Two-factor Authentication on your account, to increase We recommend that you use Two-factor Authentication on your account, to increase

View file

@ -6,11 +6,12 @@ eleventyNavigation:
order: 25 order: 25
--- ---
Projects on Codeberg use [Git](https://git-scm.com/) as their [version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) system. If you want to contribute sourcecode, it is a good idea to install Git at this point. Projects on Codeberg use [Git](https://git-scm.com/) as their [version control](https://git-scm.com/book/en/v2/Getting-Started-About-Version-Control) system. If you want to contribute source code, it is a good idea to install Git at this point.
Git runs on every OS. You can download it directly from the [Git website](https://git-scm.com/downloads), or from your operating systems package manager (if available). Git runs on every OS. You can download it directly from the [Git website](https://git-scm.com/downloads), or from your operating systems package manager (if available).
Here we provide step-by-step instructions to install it.
Here we provide step-by-step instructions to install it.
**Disclaimer**: we try to keep these instructions up-to-date, but you might need to adjust them to your machine/OS. **Disclaimer**: we try to keep these instructions up-to-date, but you might need to adjust them to your machine/OS.
## Linux ## Linux
@ -44,8 +45,8 @@ There are several possibilities to install Git on Windows. An easy one is to use
For some Git clients (see [below](#git-clients)), e.g. [RStudio](https://rstudio.com/), it is recommended to install Git as administrator on your machine. It is also possible to install as regular user, but you might have to manually specify the path to the Git executable in the settings of your Git client. For some Git clients (see [below](#git-clients)), e.g. [RStudio](https://rstudio.com/), it is recommended to install Git as administrator on your machine. It is also possible to install as regular user, but you might have to manually specify the path to the Git executable in the settings of your Git client.
### Install ### Install
If you want to install as regular user, just log in with your user account and run the installer. If you want to install as regular user, just log in with your user account and run the installer.
To install with administrator rights, either log in as administrator, or run the installer as administrator. In the latter case, right-click on the installer, select `Run as administrator` and enter your credentials: To install with administrator rights, either log in as administrator, or run the installer as administrator. In the latter case, right-click on the installer, select `Run as administrator` and enter your credentials:
<picture> <picture>
<source srcset="/assets/images/getting-started/install-git/win-run-as-admin.webp" type="image/webp"> <source srcset="/assets/images/getting-started/install-git/win-run-as-admin.webp" type="image/webp">
@ -53,36 +54,36 @@ To install with administrator rights, either log in as administrator, or run the
</picture> </picture>
From there, follow the steps in the setup wizard. It is okay to just accept the defaults, when in doubt. From there, follow the steps in the setup wizard. It is okay to just accept the defaults, when in doubt.
There are two steps for which you have to pay attention: There are two steps for which you have to pay attention:
1. Choose your editor: 1. Choose your editor:
By default, [Vim](https://www.vim.org/) will be used for Git. But if you prefer to use another one, select it here. By default, [Vim](https://www.vim.org/) will be used for Git. But if you prefer to use another one, select it here.
<picture> <picture>
<source srcset="/assets/images/getting-started/install-git/win-editor.webp" type="image/webp"> <source srcset="/assets/images/getting-started/install-git/win-editor.webp" type="image/webp">
<img src="/assets/images/getting-started/install-git/win-editor.png" alt="win-editor"> <img src="/assets/images/getting-started/install-git/win-editor.png" alt="win-editor">
</picture> </picture>
2. PATH environment: 2. PATH environment:
<picture> <picture>
<source srcset="/assets/images/getting-started/install-git/win-path.webp" type="image/webp"> <source srcset="/assets/images/getting-started/install-git/win-path.webp" type="image/webp">
<img src="/assets/images/getting-started/install-git/win-path.png" alt="win-path"> <img src="/assets/images/getting-started/install-git/win-path.png" alt="win-path">
</picture> </picture>
This makes sure that Git can be used by 3rd party software (Git clients). It is recommended (and the default) anyway. This makes sure that Git can be used by 3rd party software (Git clients). It is recommended (and the default) anyway.
> You may get the error message displayed below, that the release notes cannot be displayed. That error message can be safely ignored. You can find the release notes in `Start Menu > Git > Git Release Notes`. > You may get the error message displayed below, that the release notes cannot be displayed. That error message can be safely ignored. You can find the release notes in `Start Menu > Git > Git Release Notes`.
> >
> <picture> > <picture>
> <source srcset="/assets/images/getting-started/install-git/win-error-notes.webp" type="image/webp"> > <source srcset="/assets/images/getting-started/install-git/win-error-notes.webp" type="image/webp">
> <img src="/assets/images/getting-started/install-git/win-error-notes.PNG" alt="win-error"> > <img src="/assets/images/getting-started/install-git/win-error-notes.PNG" alt="win-error">
> </picture> > </picture>
### Run ### Run
Git can be used through the `Command Prompt` (the traditional Windows command line interpreter), the `Windows Powershell` (the "replacement" of the `Command Prompt`), the interface of your Git client, or `Git Bash`. The latter two options are recommended. Git can be used through the `Command Prompt` (the traditional Windows command line interpreter), the `Windows Powershell` (the "replacement" of the `Command Prompt`), the interface of your Git client, or `Git Bash`. The latter two options are recommended.
`Git Bash` is what comes with your Git installation. You can access it from the Start Menu: `Git > Git Bash`. `Git Bash` is what comes with your Git installation. You can access it from the Start Menu: `Git > Git Bash`.
@ -92,10 +93,10 @@ You now managed to get Git up and running. Please proceed as described in the ar
Note that the first time you push/pull (see [Clone & Commit via HTTP](/git/clone-commit-via-http)), Git will ask for your Codeberg credentials. If you did not change this setting during installation, these credentials will be saved by Windows in its [Credential Manager](https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager). This is also where you have to go in order to change them. Note that the first time you push/pull (see [Clone & Commit via HTTP](/git/clone-commit-via-http)), Git will ask for your Codeberg credentials. If you did not change this setting during installation, these credentials will be saved by Windows in its [Credential Manager](https://support.microsoft.com/en-us/help/4026814/windows-accessing-credential-manager). This is also where you have to go in order to change them.
### Update ### Update
To update Git, the easiest way is to download and run the latest version of the installer and follow the previous steps. Make sure that you run the new installer with the same rights (administrator or user) as for the original installation. If not, it will be installed twice and that will create a mess. To update Git, the easiest way is to download and run the latest version of the installer and follow the previous steps. Make sure that you run the new installer with the same rights (administrator or user) as for the original installation. If not, it will be installed twice and that will create a mess.
If you want to keep all your settings, simply tick the box `Only show new options` in the installation wizard (see screenshots above). Here, "new options" refer to the options that were not available in the previous version. If you want to keep all your settings, simply tick the box `Only show new options` in the installation wizard (see screenshots above). Here, "new options" refer to the options that were not available in the previous version.
<a name="git-clients"></a> <a name="git-clients"></a>
## Git clients ## Git clients
Git can be used from the command line as shown above, but it can also be used through graphical user interfaces called *Git clients*. Git can be used from the command line as shown above, but it can also be used through graphical user interfaces called *Git clients*.
You can find a list of some of the available Git clients on the [Git website](https://git-scm.com/downloads/guis). You can find a list of some available Git clients on the [Git website](https://git-scm.com/downloads/guis).

View file

@ -19,7 +19,7 @@ direction, ask questions and much more.
You can find the issue tracker of a project by clicking its "Issues" tab (1). You can find the issue tracker of a project by clicking its "Issues" tab (1).
There, you will see browseable and filterable (2) list of all issues. There, you will see browsable and filterable (2) list of all issues.
Many projects use labels to categorize issues. A good label to look for, if you want Many projects use labels to categorize issues. A good label to look for, if you want
to contribute to a project is the "help wanted" label. to contribute to a project is the "help wanted" label.
@ -28,13 +28,13 @@ You can switch between issues that are still open, and those that are already re
Some projects define milestones (4), to which issues can be assigned. They are good for Some projects define milestones (4), to which issues can be assigned. They are good for
visualizing the high-level progress of a project's development. visualizing the high-level progress of a project's development.
You can create an issue by clicking on the green "New Issue" button (5) at the top left You can create an issue by clicking on the green "New Issue" button (5) at the top left
of the issues list. of the issues list.
Issues in the issue tracker are public and everyone is able to read and answer to them. Issues in the issue tracker are public and everyone is able to read and answer to them.
An Issue can have an assignee, meaning someone responsible for resolving or moderating An Issue can have an assignee, meaning someone responsible for resolving or moderating
the issue. Their profile picture, with a link to their profile, can be seen in the issue the issue. Their profile picture, with a link to their profile, can be seen in the issue
list. list.
### Life of an Issue ### Life of an Issue
@ -45,8 +45,8 @@ strictly defined, based on the project you're contributing to.
The first thing that might happen is that your issue is categorized using labels. The first thing that might happen is that your issue is categorized using labels.
Your issue may be reviewed by the project's maintainer(s) and evaluated whether it i.e. might be a duplicate or an invalid bug report. Your issue may be reviewed by the project's maintainer(s) and evaluated whether it i.e. might be a duplicate or an invalid bug report.
Then, depending on what kind of issue it is, there might be a additional questions Then, depending on what kind of issue it is, there might be additional questions
or a discussion and, if applicable, the implementation of a solution (or the rejection of or a discussion and, if applicable, the implementation of a solution (or the rejection of
the issue). the issue).
Finally, the issue is closed, thus vanishing from the list of open issues. Finally, the issue is closed, thus vanishing from the list of open issues.
@ -54,7 +54,7 @@ Issues might have dependencies on other issues or pull requests preventing them
Occasionally, issues might become stale. That's when there hasn't been any progress for Occasionally, issues might become stale. That's when there hasn't been any progress for
an extended period of time (usually months). You might consider reviving these, if there an extended period of time (usually months). You might consider reviving these, if there
is a strong interest in getting them resolved (and, preferably, if you can contribute is a strong interest in getting them resolved (and, preferably, if you can contribute
something to them). something to them).
> If you encounter an abandoned project and there is no way to contact the maintainer(s), > If you encounter an abandoned project and there is no way to contact the maintainer(s),
@ -63,11 +63,11 @@ something to them).
### Things to consider ### Things to consider
#### Security bugs #### Security bugs
If the bug you have found has security implications, **do not create If the bug you have found has security implications, **do not create
an issue right away!**. Instead try contacting the project's maintainers privately. an issue right away!** Instead try contacting the project's maintainers privately.
Many projects have a dedicated e-mail-address for reporting security bugs. If the Many projects have a dedicated e-mail-address for reporting security bugs. If the
project in question doesn't, consider writing an email directly to the project's project in question doesn't, consider writing an email directly to the project's
maintainer or ask for the address in the issue tracker. maintainer or ask for the address in the issue tracker.
> **⚠** What's important is that you **don't publicly expose security bugs before they are > **⚠** What's important is that you **don't publicly expose security bugs before they are
> fixed *and* the fixes are deployed** because **otherwise you might put the users of that > fixed *and* the fixes are deployed** because **otherwise you might put the users of that
> project at severe risk**. > project at severe risk**.

View file

@ -11,7 +11,7 @@ by Codeberg e.V. and centered around Codeberg.org, a Gitea-based software forge.
On Codeberg you can develop your own [Free Software](https://simple.wikipedia.org/wiki/Free_software) projects, contribute to other On Codeberg you can develop your own [Free Software](https://simple.wikipedia.org/wiki/Free_software) projects, contribute to other
projects, [browse](https://codeberg.org/explore) through inspiring and useful projects, [browse](https://codeberg.org/explore) through inspiring and useful
free software, share your knowledge or build your projects a home in the web free software, share your knowledge or build your projects a home on the web
using [Codeberg Pages](/codeberg-pages), just to name a few. using [Codeberg Pages](/codeberg-pages), just to name a few.
Codeberg is not a corporation but a community of free software enthusiasts providing Codeberg is not a corporation but a community of free software enthusiasts providing

View file

@ -8,10 +8,10 @@ eleventyNavigation:
Clone, edit, commit, push and pull can be performed using Git directly from the command line, by using a Git client, or via the web interface. The first option is shown below and in the section [Clone & Commit via SSH](/content/git/clone-commit-via-ssh). The last option is detailed in the section [Clone & Commit via Web](/content/git/clone-commit-via-web). Clone, edit, commit, push and pull can be performed using Git directly from the command line, by using a Git client, or via the web interface. The first option is shown below and in the section [Clone & Commit via SSH](/content/git/clone-commit-via-ssh). The last option is detailed in the section [Clone & Commit via Web](/content/git/clone-commit-via-web).
The user in this examples is `knut` the polar bear and it's repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file. The user in these examples is `knut` the polar bear and its repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file.
## Clone ## Clone
*Cloning* refers to the process of creating an identical copy of a repository to the local machine. *Cloning* refers to the process of creating an identical copy of a repository to the local machine.
Clone with the Git command `clone` followed by the repo URL. Clone with the Git command `clone` followed by the repo URL.
```bash ```bash
@ -32,7 +32,7 @@ Modify an existing file:
``` ```
## Commit ## Commit
A *commit* is a record of the changes to the repository. This is like a snapshot of your edits. A *commit* is a record of the changes to the repository. This is like a snapshot of your edits.
A commit requires a commit message. For the example below, the message is "test". Keep in mind that "test" is not a very informative message, though. In the real world, make sure your commit message is informative, for you, your collaborators and anyone who might be interested in your work. Some advice on how to write a good commit message can be found on countless websites and blogs! A commit requires a commit message. For the example below, the message is "test". Keep in mind that "test" is not a very informative message, though. In the real world, make sure your commit message is informative, for you, your collaborators and anyone who might be interested in your work. Some advice on how to write a good commit message can be found on countless websites and blogs!
Command lines: Command lines:
@ -44,12 +44,12 @@ Command lines:
``` ```
## Push ## Push
The last step is to synchronize (*push*) the modifications (commit) from the local repository to the remote one on Codeberg. The last step is to synchronize (*push*) the modifications (commit) from the local repository to the remote one on Codeberg.
```bash ```bash
~/foobar$ git push https://codeberg.org/knut/foobar.git ~/foobar$ git push https://codeberg.org/knut/foobar.git
Username for 'https://codeberg.org': knut Username for 'https://codeberg.org': knut
Password for 'https://knut@codeberg.org': Password for 'https://knut@codeberg.org':
Counting objects: 3, done. Counting objects: 3, done.
Delta compression using up to 4 threads. Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done. Compressing objects: 100% (2/2), done.
@ -60,6 +60,6 @@ To https://codeberg.org/knut/foobar.git
``` ```
## Pull ## Pull
*Pulling* synchronizes the modifications (commit) from the remote repository on Codeberg to the local one. *Pulling* synchronizes the modifications (commit) from the remote repository on Codeberg to the local one.
Pulling is important when you work on different computers to make sure that all computers are on the same stage. It is even more important when you have collaborators on a project; they might change the files too, so you need to pull these modifications before you start working. Pulling is important when you work on different computers to make sure that all computers are on the same stage. It is even more important when you have collaborators on a project; they might change the files too, so you need to pull these modifications before you start working.
Because of that, it is recommended to pull before pushing. Because of that, it is recommended to pull before pushing.

View file

@ -9,7 +9,7 @@ eleventyNavigation:
> **Warning** Please make sure that before connecting to Codeberg via SSH, > **Warning** Please make sure that before connecting to Codeberg via SSH,
> you have [verified Codeberg's SSH fingerprint](/security/ssh-fingerprint)! > you have [verified Codeberg's SSH fingerprint](/security/ssh-fingerprint)!
The user in this examples is `JohnDoe` and it's repository is `foobar`. The repository was created via the Codeberg.org website including a `README.md` file. The user in these examples is `JohnDoe` and its repository is `foobar`. The repository was created via the Codeberg.org website including a `README.md` file.
```bash ```bash
~$ git clone git@codeberg.org:JohnDoe/foobar.git ~$ git clone git@codeberg.org:JohnDoe/foobar.git
@ -41,7 +41,7 @@ Commit changes to local repository.
```bash ```bash
~/foobar$ git push ~/foobar$ git push
Username for 'https://codeberg.org': JohnDoe Username for 'https://codeberg.org': JohnDoe
Password for 'https://JohnDoe@codeberg.org': Password for 'https://JohnDoe@codeberg.org':
Counting objects: 3, done. Counting objects: 3, done.
Delta compression using up to 4 threads. Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done. Compressing objects: 100% (2/2), done.

View file

@ -8,10 +8,10 @@ eleventyNavigation:
Clone, edit, commit, push and pull can be performed using Git directly from the command line, by using a Git client, or via the web interface. The first option is shown in the sections [Clone & Commit via HTTP](/git/clone-commit-via-http) and [Clone & Commit via SSH](/git/clone-commit-via-ssh). The last option is detailed below. Clone, edit, commit, push and pull can be performed using Git directly from the command line, by using a Git client, or via the web interface. The first option is shown in the sections [Clone & Commit via HTTP](/git/clone-commit-via-http) and [Clone & Commit via SSH](/git/clone-commit-via-ssh). The last option is detailed below.
The user in this examples is `knut` the polar bear and it's repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file. The user in these examples is `knut` the polar bear and its repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file.
## Clone ## Clone
*Cloning* refers to the process of creating an identical copy of a repository to the local machine. *Cloning* refers to the process of creating an identical copy of a repository to the local machine.
Copy the repo URL from the Codeberg website to your Git client using the `Copy` icon. Copy the repo URL from the Codeberg website to your Git client using the `Copy` icon.
@ -23,7 +23,7 @@ Copy the repo URL from the Codeberg website to your Git client using the `Copy`
</picture> </picture>
## Edit ## Edit
Click on the file you want to edit from the list of files in the repo. Let's try it here with the `README.md` file. Click on the file you want to edit from the list of files in the repo. Let's try it here with the `README.md` file.
The pencil tool (`Edit File`) will open a new window. The pencil tool (`Edit File`) will open a new window.
<picture> <picture>
@ -31,7 +31,7 @@ The pencil tool (`Edit File`) will open a new window.
<img src="/assets/images/git/clone-commit-via-web/edit1.png" alt="edit1"> <img src="/assets/images/git/clone-commit-via-web/edit1.png" alt="edit1">
</picture> </picture>
There you can edit the file as you wish. There you can edit the file as you wish.
The `Preview` tab shows you how the file will look like, and the `Preview Changes` will highlight the changes to the file (red for deletions and green for additions). The `Preview` tab shows you how the file will look like, and the `Preview Changes` will highlight the changes to the file (red for deletions and green for additions).
<picture> <picture>
@ -40,26 +40,26 @@ The `Preview` tab shows you how the file will look like, and the `Preview Change
</picture> </picture>
## Commit ## Commit
A *commit* is a record of the changes to the repository. This is like a snapshot of your edits. A *commit* is a record of the changes to the repository. This is like a snapshot of your edits.
The commit section is at the bottom of the edit window: The commit section is at the bottom of the edit window:
<picture> <picture>
<source srcset="/assets/images/git/clone-commit-via-web/commit.webp" type="image/webp"> <source srcset="/assets/images/git/clone-commit-via-web/commit.webp" type="image/webp">
<img src="/assets/images/git/clone-commit-via-web/commit.png" alt="commit"> <img src="/assets/images/git/clone-commit-via-web/commit.png" alt="commit">
</picture> </picture>
A commit requires a commit message. A default message is added, but do not hesitate to edit it. Make sure your commit message is informative, for you, your collaborators and anyone who might be interested in your work. Some advice on how to write a good commit message can be found on countless websites and blogs! A commit requires a commit message. A default message is added, but do not hesitate to edit it. Make sure your commit message is informative, for you, your collaborators and anyone who might be interested in your work. Some advice on how to write a good commit message can be found on countless websites and blogs!
If you intend to start a pull request with this commit, you should choose the option `Create a new branch for this commit and start a pull request`. It will make it easier to work on the different commits without mixing them if they are in different forks. Check the documentation on [Pull requests and Git flow](/collaborating/pull-requests-and-git-flow) for more details. If you intend to start a pull request with this commit, you should choose the option `Create a new branch for this commit and start a pull request`. It will make it easier to work on the different commits without mixing them if they are in different forks. Check the documentation on [Pull requests and Git flow](/collaborating/pull-requests-and-git-flow) for more details.
Submit your changes by clicking on `Commit Changes`. Submit your changes by clicking on `Commit Changes`.
## Push and pull ## Push and pull
Synchronizing the modifications (commit) from the local repository to the remote one on Codeberg is called *pushing*. Synchronizing the modifications (commit) from the local repository to the remote one on Codeberg is called *pushing*.
*Pulling* synchronizes the modifications (commit) from the remote repository on Codeberg to the local one. *Pulling* synchronizes the modifications (commit) from the remote repository on Codeberg to the local one.
Pulling is important when you work on different computers to make sure that all computers are on the same stage. It is even more important when you have collaborators on a project; they might change the files too, so you need to pull these modifications before you start working. Pulling is important when you work on different computers to make sure that all computers are on the same stage. It is even more important when you have collaborators on a project; they might change the files too, so you need to pull these modifications before you start working.
Because of that, it is recommended to pull before pushing. Because of that, it is recommended to pull before pushing.
Pushing and pulling make sense only if you work locally. This is why there is no "push" or "pull" button on the Codeberg web interface; committing there already pushes to the remote repository on Codeberg, and there is therefore nothing to pull (except pull requests of course). Pushing and pulling make sense only if you work locally. This is why there is no "push" or "pull" button on the Codeberg web interface; committing there already pushes to the remote repository on Codeberg, and there is therefore nothing to pull (except pull requests of course).

View file

@ -6,7 +6,7 @@ eleventyNavigation:
order: 50 order: 50
--- ---
Sometimes you will merge multiple commits into one. Maybe the commits are "dirty" full with not working code or embarrasing commit messages. This solution is only one of mutliple possible solutions. See this [stackoverflow question](https://stackoverflow.com/q/2563632/4865723) for more details and variants. Sometimes you will merge multiple commits into one. Maybe the commits are "dirty" full of non-working code or embarrassing commit messages. This solution is only one of multiple possible solutions. See this [stackoverflow question](https://stackoverflow.com/q/2563632/4865723) for more details and variants.
Here is an example. Here is an example.

View file

@ -16,7 +16,7 @@ You can support Codeberg in various ways:
We're happy about every free software project actively using Codeberg, We're happy about every free software project actively using Codeberg,
because we believe that every free project deserves a free home. because we believe that every free project deserves a free home.
We welcome free software projects that consider to move away from one of the We welcome free software projects that consider moving away from one of the
commercial software forges, such as GitHub, GitLab or Bitbucket. commercial software forges, such as GitHub, GitLab or Bitbucket.
By joining and using Codeberg, you're already helping our mission a lot - thank you! By joining and using Codeberg, you're already helping our mission a lot - thank you!

View file

@ -38,7 +38,7 @@ If you don't already have an authenticator app and you're not sure which app to
<img src="/assets/images/security/2fa/qr-scan.jpg" alt="Scanning QR Code"> <img src="/assets/images/security/2fa/qr-scan.jpg" alt="Scanning QR Code">
</picture> </picture>
After scanning the QR code with your app, enter the six digit code displayed in your app into the "Passcode" field of the settings form, then click "Verify". After scanning the QR code with your app, enter the six-digit code displayed in your app into the "Passcode" field of the settings form, then click "Verify".
### Step 4: Store your scratch token in a safe place ### Step 4: Store your scratch token in a safe place
If your phone ever breaks, get lost or stolen, you can recover your account using the scratch token. If your phone ever breaks, get lost or stolen, you can recover your account using the scratch token.
@ -58,10 +58,10 @@ That's it - you have now configured 2FA for your account.
From now on, each time you log into Codeberg, you will be asked for an authentication code from your app, adding a layer of security over using only a password. From now on, each time you log into Codeberg, you will be asked for an authentication code from your app, adding a layer of security over using only a password.
## Personal access token ## Personal access token
If you push via HTTP (see [Clone & Commit via HTTP](/git/clone-commit-via-http)), an extra step will be needed to create a personal access token. This token will replace your normal password (+ authentication code) on Codeberg. If you push via HTTP (see [Clone & Commit via HTTP](/git/clone-commit-via-http)), an extra step will be needed to create a personal access token. This token will replace your normal password (+ authentication code) on Codeberg.
In your profile settings on Codeberg.org, go to the `Applications` tab. In your profile settings on Codeberg.org, go to the `Applications` tab.
In the section `Manage Access Tokens`, add a `Token Name` and confirm by clicking on the green `Generate Token`. In the section `Manage Access Tokens`, add a `Token Name` and confirm by clicking on the green `Generate Token`.
<picture> <picture>
<source srcset="/assets/images/security/2fa/applications.webp" type="image/webp"> <source srcset="/assets/images/security/2fa/applications.webp" type="image/webp">
@ -77,4 +77,4 @@ Make sure you save the generated token in a safe place, because it will not be s
When asked for your password, just supply the token. When asked for your password, just supply the token.
You can create as many token as you like: one for each computer, one for each Git client, one for each session... you decide! You can also revoke tokens at any time by pressing the red `Delete` next to the token (see previous screenshot). You can create as many token as you like: one for each computer, one for each Git client, one for each session... you decide! You can also revoke tokens at any time by pressing the red `Delete` next to the token (see previous screenshot).

View file

@ -7,9 +7,9 @@ eleventyNavigation:
It is recommended to use one key per client. It means if you access your Codeberg repository from your home PC, your laptop and your office PC you should generate separate keys for each machine. It is recommended to use one key per client. It means if you access your Codeberg repository from your home PC, your laptop and your office PC you should generate separate keys for each machine.
In the context of Codeberg you should decide yourself if you add a pasphrase to your SSH key or not. Read the on-going discussion about that topic in this [Codeberg-Issue](https://codeberg.org/Codeberg/Documentation/issues/2). In the context of Codeberg you should decide yourself if you add a passphrase to your SSH key or not. Read the on-going discussion about that topic in this [Codeberg-Issue](https://codeberg.org/Codeberg/Documentation/issues/2).
## Generating a SSH key (pair) ## Generating an SSH key (pair)
1. Open a shell (e.g. `git-bash` on Windows or `bash` on Linux). 1. Open a shell (e.g. `git-bash` on Windows or `bash` on Linux).
@ -34,14 +34,14 @@ In the context of Codeberg you should decide yourself if you add a pasphrase to
4. Enter a passphrase if you want. *See further [discussions](https://codeberg.org/Codeberg/Documentation/issues/2) about the necessity of a passphrase in the context of Codeberg.* 4. Enter a passphrase if you want. *See further [discussions](https://codeberg.org/Codeberg/Documentation/issues/2) about the necessity of a passphrase in the context of Codeberg.*
## Add the SSH key to Codeberg ## Add the SSH key to Codeberg
1. Copy the SSH key to your clipboard. Attention: Copy only the public part of the key not the private one. You can identify it by the `.pub` extension. By default you can find the public key in `$HOME/.ssh/id_rsa.pub`. 1. Copy the SSH key to your clipboard. Attention: Copy only the public part of the key not the private one. You can identify it by the `.pub` extension. By default, you can find the public key in `$HOME/.ssh/id_rsa.pub`.
On Linux you can use the `xclip` command like this On Linux you can use the `xclip` command like this
```shell ```shell
$ xclip -sel clip < ~/.ssh/id_rsa.pub $ xclip -sel clip < ~/.ssh/id_rsa.pub
``` ```
On Windows use a text editor (e.g. Notepad) or `clip` on the commandline On Windows use a text editor (e.g. Notepad) or `clip` on the command line
```shell ```shell
$ type .ssh/id_rsa.pub | clip $ type .ssh/id_rsa.pub | clip
``` ```
@ -57,7 +57,7 @@ In the context of Codeberg you should decide yourself if you add a pasphrase to
<source srcset="/assets/images/security/ssh-key/add-ssh-key.webp" type="image/webp"> <source srcset="/assets/images/security/ssh-key/add-ssh-key.webp" type="image/webp">
<img src="/assets/images/security/ssh-key/add-ssh-key.png" alt="SSH Key Settings"> <img src="/assets/images/security/ssh-key/add-ssh-key.png" alt="SSH Key Settings">
</picture> </picture>
4. Give an appropriate name for the key. 4. Give an appropriate name for the key.
5. Paste your key string from the clipboard into __content__ field. 5. Paste your key string from the clipboard into __content__ field.
@ -74,12 +74,12 @@ The output should look like this:
Hi there, You've successfully authenticated, but Gitea does not provide shell access. Hi there, You've successfully authenticated, but Gitea does not provide shell access.
If this is unexpected, please log in with password and setup Gitea under another user. If this is unexpected, please log in with password and setup Gitea under another user.
``` ```
*Note: All codeberg users share a single unix user named `git` which is used to check out repositories. Depending on the key provided, permission is granted or denied. You can check out all repositories with your key which you have permission for. You can push code to all repositories where you have write access.* *Note: All codeberg users share a single unix user named `git` which is used to check out repositories. Depending on the key provided, permission is granted or denied. You can check out all repositories with your key which you have permission for. You can push code to all repositories where you have write access.*
## Avoid re-typing the passphrase ## Avoid re-typing the passphrase
Assuming you created a secure key with passphrase, SSH will prompt you for your passphrase for every connection. Common desktop environments like OSX or Gnome will offer you to cache your passphrase via an SSH agent. Assuming you've created a secure key with passphrase, SSH will prompt you for your passphrase for every connection. Common desktop environments like OSX or Gnome will offer you to cache your passphrase via an SSH agent.
If you are working at the command line, you can alternatively do this directly: If you are working at the command line, you can alternatively do this directly: