forked from IELS1001-23-24/programming-course
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
103 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,102 @@ | ||
[<-- Tilbake](/README.md) | ||
|
||
# Commit | ||
|
||
Git er basert på commits, som består av filendringer. Et git repository består av mange commits i en bestemt rekkefølge. Under er et eksempel av hvordan en slik historikk kan se ut. | ||
|
||
```mermaid | ||
--- | ||
title: Git History | ||
--- | ||
gitGraph | ||
commit id: "Adds a print" | ||
commit id: "Adds a second print" | ||
commit id: "Adds a third print" | ||
commit id: "Removes the third print" | ||
``` | ||
|
||
### Diff for hver enkelt commit | ||
|
||
Forskjellene mellom to commits kalles en diff. Under er diffen for hver enkelt commit i eksempelet over. | ||
|
||
### Adds a print | ||
|
||
```diff | ||
+ print("Hello World!") | ||
``` | ||
|
||
### Adds a second print | ||
|
||
```diff | ||
print("Hello World!") | ||
+ print("Hello World 2!") | ||
``` | ||
|
||
### Adds a third print | ||
|
||
```diff | ||
print("Hello World!") | ||
print("Hello World 2!") | ||
+ print("Hello World 3!") | ||
``` | ||
|
||
### Removes the third print | ||
|
||
```diff | ||
print("Hello World!") | ||
print("Hello World 2!") | ||
- print("Hello World 3!") | ||
``` | ||
|
||
## Summen av alle commits | ||
|
||
```diff | ||
print("Hello World!") | ||
print("Hello World 2!") | ||
``` | ||
|
||
## Lage et commit | ||
|
||
Når du har gjennomført [Logikk](/Exercises/Logic/README.md) øvingen, har du mest sannsynlig endret noen av filene. Du kan hvilke filer du har endret i Source Control fanen. Trykk på en fil for å se hva du har endret. | ||
|
||
![Source Control](assets/source-control.png) | ||
|
||
Hvis du trykker på eller holder musen over en av filene , får du opp disse knappene. Pilen fjerner endringene, og pluss knappen vil flytte endringene fra "Changes" til "Staged Changes". Kun endringer i "Staged Changes" vil bli med i et commit. | ||
|
||
![Stage button](assets/stage-button.png) | ||
|
||
Når du har lagt til endringene, skriv en beskrivelse av hva du har gjort i "Message" feltet. Når du er ferdig, trykk på "Commit" knappen. | ||
|
||
![Commit Message](commit-message.png) | ||
|
||
## Inspiser git historikk | ||
|
||
Nå er endringene dine lagret i et commit i ditt lokale git repo. Trykk på historikk knappen for å se commit historikken din. | ||
|
||
![Open Git History](assets/open-git-history.png) | ||
|
||
## Git Push | ||
|
||
Trykk på Sync Changes for å pushe endringene dine til GitHub. | ||
|
||
![Sync Changes](assets/sync-changes.png) | ||
|
||
Gå til forken din i GitHub og se endringene i commit historikken. | ||
|
||
## Åpne repo i GitHub | ||
|
||
Åpne command palette | ||
|
||
![Open Command Palette](assets/open-command-palette.png) | ||
|
||
Kjør kommandoen | ||
|
||
``` | ||
Open In Github: Project | ||
``` | ||
|
||
## Inspiser historikk i GitHub | ||
|
||
I github kan du se commit historikken ved å trykke på commits telleren. | ||
|
||
![Open Github Commit History](assets/open-github-commit-history.png) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters