Git; some grammar and typos

This commit is contained in:
Martijn de Boer 2020-10-16 16:37:34 +02:00
parent db1995d687
commit 25b6ea0132
No known key found for this signature in database
GPG key ID: 9D2E42402DD372D1
4 changed files with 21 additions and 21 deletions

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).
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
*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.
```bash
@ -32,7 +32,7 @@ Modify an existing file:
```
## 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!
Command lines:
@ -44,12 +44,12 @@ Command lines:
```
## 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
~/foobar$ git push https://codeberg.org/knut/foobar.git
Username for 'https://codeberg.org': knut
Password for 'https://knut@codeberg.org':
Password for 'https://knut@codeberg.org':
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
@ -60,6 +60,6 @@ To https://codeberg.org/knut/foobar.git
```
## Pull
*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* 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.

View file

@ -9,7 +9,7 @@ eleventyNavigation:
> **Warning** Please make sure that before connecting to Codeberg via SSH,
> 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
~$ git clone git@codeberg.org:JohnDoe/foobar.git
@ -41,7 +41,7 @@ Commit changes to local repository.
```bash
~/foobar$ git push
Username for 'https://codeberg.org': JohnDoe
Password for 'https://JohnDoe@codeberg.org':
Password for 'https://JohnDoe@codeberg.org':
Counting objects: 3, done.
Delta compression using up to 4 threads.
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.
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
*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.
@ -23,7 +23,7 @@ Copy the repo URL from the Codeberg website to your Git client using the `Copy`
</picture>
## 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.
<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">
</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).
<picture>
@ -40,26 +40,26 @@ The `Preview` tab shows you how the file will look like, and the `Preview Change
</picture>
## 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>
<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">
</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`.
## 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 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* 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.
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
---
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 not 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.