Clone and commit via Web
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 48 KiB After Width: | Height: | Size: 48 KiB |
|
Before Width: | Height: | Size: 11 KiB After Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 84 KiB After Width: | Height: | Size: 84 KiB |
|
|
@ -3,9 +3,10 @@ eleventyNavigation:
|
|||
key: CloneCommitViaHTTP
|
||||
title: Clone & Commit via HTTP
|
||||
parent: Git
|
||||
order: 20
|
||||
---
|
||||
|
||||
Clone, edit, commit, push and pull can be performed either on the Codeberg web interface, using Git directly through command lines, or by using a Git client. The first two possibilities are shown 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 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 `PolarBear` and it's repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file.
|
||||
|
||||
|
|
@ -22,28 +23,14 @@ remote: Total 3 (delta 0), reused 0 (delta 0)
|
|||
Unpacking objects: 100% (3/3), 214 bytes | 1024 bytes/s, done.
|
||||
```
|
||||
|
||||
Alternatively, copy the repo URL from the Codeberg website to your Git client using the `Copy` icon, or download the repo either as ZIP or TAR.GZ using the `Download Repository` icon.
|
||||
|
||||

|
||||
|
||||
## Edit
|
||||
Modify an existing file using command lines:
|
||||
Modify an existing file:
|
||||
|
||||
```bash
|
||||
~$ cd foobar
|
||||
~/foobar$ vim README.md
|
||||
```
|
||||
|
||||
On the Codeberg.org website, 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.
|
||||
|
||||

|
||||
|
||||
There you can able to 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).
|
||||
|
||||

|
||||
|
||||
## Commit
|
||||
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!
|
||||
|
|
@ -56,14 +43,6 @@ Command lines:
|
|||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
```
|
||||
|
||||
The commit section is at the bottom of the edit window:
|
||||
|
||||

|
||||
|
||||
A default message is added, but do not hesitate to edit it.
|
||||
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](content/collaborating/pull-requests-and-git-flow) for more details.
|
||||
Validate by clicking on `Commit Changes`.
|
||||
|
||||
## Push
|
||||
The last step is to synchronize (*push*) the modifications (commit) from the local repository to the remote one on Codeberg.
|
||||
|
||||
|
|
@ -84,5 +63,3 @@ To https://codeberg.org/PolarBear/foobar.git
|
|||
*Pulling* is the reverse of pushing: it 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.
|
||||
Because of that, it is recommended to pull before pushing.
|
||||
|
||||
Obviously 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).
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ eleventyNavigation:
|
|||
key: CloneCommitViaSSH
|
||||
title: Clone & Commit via SSH
|
||||
parent: Git
|
||||
order: 40
|
||||
---
|
||||
|
||||
> **Warning** Please make sure that before connecting to Codeberg via SSH,
|
||||
|
|
|
|||
51
content/git/clone-commit-via-web.md
Normal file
|
|
@ -0,0 +1,51 @@
|
|||
---
|
||||
eleventyNavigation:
|
||||
key: CloneCommitViaWeb
|
||||
title: Clone & Commit via Web
|
||||
parent: Git
|
||||
order: 30
|
||||
---
|
||||
|
||||
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](/content/git/clone-commit-via-http) and [Clone & Commit via SSH](/content/git/clone-commit-via-ssh). The last option is detailed below.
|
||||
|
||||
The user in this examples is `PolarBear` and it's repository is `foobar`. The repository was created via the Codeberg website including a `README.md` file.
|
||||
|
||||
## Clone
|
||||
*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, or download the repo either as ZIP or TAR.GZ using the `Download Repository` icon.
|
||||
|
||||

|
||||
|
||||
## 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.
|
||||
The pencil tool (`Edit File`) will open a new window.
|
||||
|
||||

|
||||
|
||||
There you can able to 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).
|
||||
|
||||

|
||||
|
||||
## Commit
|
||||
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:
|
||||
|
||||

|
||||
|
||||
A commit requires a commit message. A default message is added, but do not hesitate to edit it. 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!
|
||||
|
||||
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](content/collaborating/pull-requests-and-git-flow) for more details.
|
||||
|
||||
Validate by clicking on `Commit Changes`.
|
||||
|
||||
## Push and pull
|
||||
Synchronizing the modifications (commit) from the local repository to the remote one on Codeberg is called *pushing*.
|
||||
|
||||
*Pulling* is the reverse of pushing: it 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.
|
||||
Because of that, it is recommended to pull before pushing.
|
||||
|
||||
Obviously 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).
|
||||
|
|
@ -3,7 +3,7 @@ eleventyNavigation:
|
|||
key: Git
|
||||
title: Working with Git Repositories
|
||||
icon: code-branch
|
||||
order: 20
|
||||
order: 10
|
||||
---
|
||||
|
||||
On these pages, you will learn how to use the Git version control system
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ eleventyNavigation:
|
|||
key: SquashCommits
|
||||
title: Merge multiple commits into one
|
||||
parent: Git
|
||||
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.
|
||||
|
|
|
|||