Skip to content

Commit d4812cf

Browse files
committed
Update the quarto file
1 parent f8e637f commit d4812cf

File tree

1 file changed

+44
-8
lines changed

1 file changed

+44
-8
lines changed

git-training.qmd

Lines changed: 44 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ When done, open `Git Bash`
5151

5252
Open a `Terminal` window and type:
5353

54-
`sudo apt install git git-lfs git-flow`
54+
`sudo apt install git`
5555

5656
## Git configuration
5757

@@ -227,7 +227,9 @@ gitGraph
227227

228228
## Reverting a commit
229229

230-
- Type `git revert 07e8835` (replace `07e8835` by your commit id)
230+
To revert a commit, i.e. to cancel changes done in a previous one:
231+
232+
- Type `git revert 07e8835` (replace `07e8835` by your commit id)
231233

232234
```{mermaid}
233235
%%| fig-width: 10
@@ -896,7 +898,7 @@ gitGraph
896898

897899
- Type `git diff develop main`
898900

899-
::: notes
901+
::: callout-notes
900902
You will see the text that has been added to the LICENCE file (69bbd79 commit)
901903
:::
902904

@@ -918,7 +920,23 @@ classDef remote fill:yellow,stroke:black,color:black
918920
class id1,id2 local;
919921
```
920922

921-
## Deleting a branch
923+
## Using branches on remote servers
924+
925+
To push a branch on a remote server
926+
927+
- Switch to the branch you want to push: `git checkout develop`
928+
- Push the branch as follows: `git push -u origin develop`.
929+
930+
::: callout-important
931+
On the `push` command, the last argument is the name branch on the remote server. Make it consistent with the local
932+
branch
933+
:::
934+
935+
::: callout-notes
936+
Use `git branch -vv` extensively to check the links between local/remote branches.
937+
:::
938+
939+
## Deleting a branch (locally)
922940

923941
- Type `git checkout main`
924942
- Type `git branch -d develop`
@@ -933,26 +951,44 @@ An error occurs! The suppression of `feat-com` implies the loss of the `d9d02608
933951
The suppression of `develop` was ok because the content of commit `3rd` is included in the merge.
934952
:::
935953

954+
## Deleting a branch (remotely)
936955

956+
Deletion from the remote branch is not automatic. To delete branch remotely:
957+
958+
- `git push origin --delete develop`
959+
960+
::: callout-important
961+
Make sure that the branch should be removed or has been merged. Delete locally first and then remotely
962+
:::
963+
964+
::: callout-tip
965+
For the lazy people, the [Git Flow](https://github.com/nvie/gitflow) extension, managing branches is very easy! Everything is almost done automatically!
966+
:::
937967

938968
# Large file storage (LFS)
939969

940-
## LFS
970+
## What for?
941971

942972
To version (reasonably) large files (images, data samples) $\rightarrow$ Git with [LFS](https://git-lfs.github.com/) extension.
943973

944974
::: callout-warning
945975
Make sure that the remote host is compatible with LFS (GitHub is compatible)
946976
:::
947977

948-
- Type `git lfs install` to activate the extension
978+
979+
## LFS install
980+
981+
- LFS is automatically installed with Git on Windows.
982+
- On Linux, it can be installed using `sudo apt install git`
983+
- When it is installed, you need to activate it. To do so, type `git lfs install`
984+
985+
## Tracking files with LFS
986+
949987
- Create a `data.csv` file and add `Year,Size,Species`
950988
- Type `git lfs track "*.csv"`
951989

952990
A `.gitattributes` file has appeared, which list all the file extensions managed by Git LFS.
953991

954-
## Large file storage
955-
956992
- Type `git add .gitattributes data.csv`
957993
- Type `git commit -m "Using LFS"`
958994
- Type `git push`

0 commit comments

Comments
 (0)