forked from ksylor/ohshitgit
-
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.
Add Finnish (fi) translations (ksylor#78)
* Add Finnish as a language, translated index.html, and partials * Translated noswears tips * Translations for swear tips * Small fixes to noswear tips * One more swear to intro.njk
- Loading branch information
Showing
30 changed files
with
397 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
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,6 @@ | ||
--- | ||
layout: layouts/page.njk | ||
locale: fi | ||
contentType: noswears | ||
title: Hyvänen aika, Git!?! | ||
--- |
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,5 @@ | ||
<footer> | ||
<small class="contact">Mikä on sun 'Hyvänen aika git?' kokemus? Jaa se!</small> | ||
<small class="twitter">{% twitter_link "ksylor" %}</small> | ||
<small class="copyright">{{site.copyright | safe}}</small> | ||
</footer> |
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,3 @@ | ||
<p>Git on vaikea ohjelma: mokaaminen on helppoa, ja sen keksiminen miten virheet korjataan, on suorastaan mahdotonta. Git:in dokumentaatioon turvautuminen on varsinainen muna-kana-ongelma: et voi hakea korjausta sotkuusi <em>ellet tiedä jo tiedä sitä termiä jota olet etsimässä</em> jotta saat ongelmasi ratkaistua.</p> | ||
|
||
<p>Tässä on jotain esimerkkejä niistä tilanteista joihin olen joutunut, ja ohjeet <em>selkellä suomella</em> siitä miten sain itseni niistä ulos.</p> |
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 @@ | ||
<p>*Huomio: Tämän sivuston ei ole tarkoitus olla tyhjentävä dokumentaatio. Ja kyllä, on olemassa tapoja tehdä nämä samat asiat teoreettisesti puhtaammin tai jollain muulla tavalla, mutta monen yrityksen ja erehdyksen jälkeen, kiroillen ja heittäen pöytiä, olen todennut näiden ohjeiden toimivan. Sain hullun päähänpiston jakaa ne maailmalle sopivan kevytmielisesti. Ota tai jätä!</p> |
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,4 @@ | ||
<p>Kiitos paljon seuraaville henkilöille, jotka ovat vapaaehtoisesti kääntäneet tämän sivuston eri kielille! Olette upeita! | ||
{% include "partials/collaborator-list.njk" %}. Mukana ovat myös olleet {% include "partials/otherhelper-list.njk" %}</p> | ||
|
||
<p>Jos haluat auttaa tämän sivuston kääntämisessä, tee PR täällä {% github_link %}</p> |
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,18 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, tein jotain väärin, kai tässä ohjelmassa on joku aikakone!?! | ||
id: magic-time-machine | ||
order: 1 | ||
--- | ||
|
||
```git | ||
git reflog | ||
# Näet listan kaikesta mitä olet | ||
# tehnyt git:ssä kaikissa haaroissa! | ||
# Jokaisella haaralla on indeksi osoitteessa HEAD@{index} | ||
# etsi se kohta jossa kaikki toimi, ennen kuin rikoit kaiken | ||
git reset HEAD@{index} | ||
# maaginen aikakone | ||
``` | ||
|
||
Voit käyttää tätä komentoa saadaksesi takaisin jotain jonka poistit vahingossa, tai siirtääksesi kamaa jota kokeilit ennen kuin rikoit repon, tai toipuaksesi pahasta mergestä, tai muuten vaan palataksesi kohtaan jossa asiat oikeasti toimivat. Käytän `reflog`-komentoa PALJON. Iso hatunnosto niille monille monille monille monille monille ihmisille, jotka ehdottivat tämän komennon lisäämistä! |
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,18 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, tein commitin ja huomasin heti että pitää tehdä vielä yksi muutos! | ||
id: change-last-commit | ||
order: 2 | ||
--- | ||
|
||
```git | ||
# tee tarvitsemasi muutos | ||
git add . # tai lisää yksittäiset tiedostot | ||
git commit --amend --no-edit | ||
# nyt viimeisin committisi sisältää sen muutoksen! | ||
# VAROITUS! älä ikinä käytä --amend komentoa julkisille commiteille | ||
``` | ||
|
||
Tämä tapahtuu usein kun ajan testejä ja linttereitä... ja yh, silloin kun unohdan laittaa välimerkin yhtäsuuruusmerkin perään. Saman muutoksen voisi tehdä omana committinaan ja sitten ajaa komennon `rebase -i` jotta puristat commitit yhteen, mutta tämä on miljoona kertaa nopeampaa. | ||
|
||
*Varoitus: Älä ikinä käytä amend-komentoa commiteille jotka on jo puskettu julkiseen/jaettuun haaraan! Käytä amend-komentoa vain muutoksiin jotka ovat lokaalissa ympäristössäsi tai muuten tulee ongelmia.* |
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,12 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, haluan muuttaa edellisen commitin viestiä! | ||
id: change-last-commit-message | ||
order: 3 | ||
--- | ||
```git | ||
git commit --amend | ||
# seuraa ohjeita commit-viestin muokkaamiseen | ||
``` | ||
|
||
Typerät commit-viestin muotoiluvaatimukset. |
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,16 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, committasin päähaaraan jotain jonka olisi pitänyt olla toisessa haarassa! | ||
id: accidental-commit-master | ||
order: 4 | ||
--- | ||
|
||
```git | ||
# luodaan uusi haara päähaaran nykyisestä tilasta | ||
git branch uuden-haaran-nimi | ||
# poistetaan uusin commit päähaarasta | ||
git reset HEAD~ --hard | ||
git checkout uuden-haaran-nimi | ||
# uusin committisi on nyt uudessa haarassa :) | ||
``` | ||
Huomio: tämä ei toimi jos olet jo puskenut muutokset julkiseen/jaettuun haaraan, ja jos olet kokeillut jo muita temppuja, voi olla että joudut käyttämään komentoa `git reset HEAD@{näin-monta-committia-taaksepäin}` komennon `HEAD~` sijaan. Voi surku. Myös, kiitos monille monille monille ihmisille, jotka ehdottivat upen tavan tehdä tämän lyhyemmin kuin mitä itse käytin. Kiitos teille! |
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,29 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, commitoin vahingossa väärään haaraan! | ||
id: accidental-commit-wrong-branch | ||
order: 5 | ||
--- | ||
|
||
```git | ||
# perutaan uusin commit, mutta jätetään muutokset saataville | ||
git reset HEAD~ --soft | ||
git stash | ||
# siirrytään oikeaan haaraan | ||
git checkout name-of-the-correct-branch | ||
git stash pop | ||
git add . # tai lisää yksittäisiä tiedostoja | ||
git commit -m "viestisi tähän" | ||
# nyt muutoksesi ovat oikeassa haarassa | ||
``` | ||
|
||
Monet ihmiset ovat ehdottaneet `cherry-pick`-komennon käyttämistä tässä tilanteessa, joten voit käyttää sitäkin valitaksesi mitkä muutokset haluat! | ||
|
||
```git | ||
git checkout oikean-haaran-nimi | ||
# napataan uusin commit päähaaraan | ||
git cherry-pick master | ||
# poistetaan se päähaarasta | ||
git checkout master | ||
git reset HEAD~ --hard | ||
``` |
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,14 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, yritin ajaa `diff`-komennon, mutta tuloste on tyhjä?! | ||
id: dude-wheres-my-diff | ||
order: 6 | ||
--- | ||
|
||
Jos tiedät että olet tehnyt muutoksia tiedostoihin, muuta `diff`-komennon tuloste näyttää tyhjää, olet luultavasti siirtänyt tiedostot jo `add`-komentolla valmistelualueelle (staging), ja nähdäkseksesi muutokset, joudut lisäämään erityisen option. | ||
|
||
```git | ||
git diff --staged | ||
``` | ||
|
||
Sarjassamme omituista ¯\\\_(ツ)\_/¯ (ja kyllä, tiedän että tämä on toiminnallisuus, ei virhetilanne, mutta se on hämmentävää ja epäintuitiivista kun törmäät tähän ensimmäisen kerran!) |
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,21 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, haluan poistaa commitin ennen 5 tuoreinta committia! | ||
id: undo-a-commit | ||
order: 7 | ||
--- | ||
|
||
```git | ||
# etsi commit jonka haluat poistaa | ||
git log | ||
# käytä nuolinäppäimiä mennäksesi eteen- ja taaksepäin historiassa | ||
# kun löydät haluamasi commitin, tallenna sen hash | ||
git revert [tallennettu hash] | ||
# git lisää uuden commitin joka poistaa kyseisen commitin | ||
# seuraa ohjeita muokataksesi commit-viestiä | ||
# tai vain tallenna ja committaa | ||
``` | ||
|
||
Kävi ilmi että ei tarvisekaan kopioida ja liittää tiedoston vanhaa sisältöä muokataksesi tehtyjä muutoksia! Jos olet tehnyt bugin, voit peruuttaa commitissa olevat muutokset kerralla käyttämällä `revert`-komentoa. | ||
|
||
Voit myös käyttää `revert`-komentoa yhteen tiedostoon yhden commitin sijaan! Mutta tietenkin, git-mäiseen tapaan, sen tekeminen onkin sitten aivan eri komentosarja... |
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,18 @@ | ||
--- | ||
tags: tip | ||
title: Hyvänen aika, haluan poistaa muutokseni yhteen tiedostoon! | ||
id: undo-a-file | ||
order: 8 | ||
--- | ||
|
||
```git | ||
# etsi hash tai commit ajalta ennen kuin teit muutoksia tiedostoon | ||
git log | ||
# käytä nuolinäppäimiä mennäksesi eteen- ja taaksepäin historiassa | ||
# kun löydät haluamasi commitin, tallenna sen hash | ||
git checkout [tallennettu hash] -- polku/tiedostoon | ||
# tiedoston vanha versio on nyt indeksissä | ||
git commit -m "Vau, ei tarvii kopioida-ja-liittää tiedoston muutoksia" | ||
``` | ||
|
||
Kun viimein löysin tämän, se oli HUIKEAA. HUIKEAA. HUI-KE-AA. Mutta vakavasti ottaen, miten ihmeessä `checkout --` on mukamas järkevin komento peruuttaa tiedoston muutokset? :pui-nyrkkiä-linus-torvaldsille: |
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,28 @@ | ||
--- | ||
tags: tip | ||
title: Unohda tämä sotku, luovutan kokonaan. | ||
id: forget-this-noise | ||
note: tämän pitäisi aina olla viimeisenä listalla, joten järjestysnumero on 20, ettei tätä tarvitse uudelleen nimetä tai järjestää | ||
order: 20 | ||
--- | ||
|
||
```git | ||
cd .. | ||
sudo rm -r typerä-git-repo-kansio | ||
git clone https://joku.github.url/typerä-git-repo-kansio.git | ||
cd typerä-git-repo-kansio | ||
``` | ||
|
||
Kiitokset Eric V:lle tästä. Kaikki valitukset `sudo`-komennon käyttämisestä voi ohjata hänelle. | ||
|
||
Mutta oikeasti, jos haarasi on niin sekaisin että ainoa vaihtoehto on nollata reposi tila samaan tilanteeseen kuin repon remote-versio, ja haluat tehdä tämän "git-hyväksytyllä" tavalla, kokeile tätä. Mutta muista että seuraukset ovat tuhoisat ja peruuttamattomat! | ||
|
||
```git | ||
# haetaan origin-haaran uusin tila | ||
git fetch origin | ||
git checkout master | ||
git reset --hard origin/master | ||
# poista ei-seuratut tiedostot ja kansiot | ||
git clean -d --force | ||
# toista checkout/reset/clean-komennot jokaiselle sotkuiselle haaralle | ||
``` |
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,6 @@ | ||
--- | ||
layout: layouts/page.njk | ||
locale: fi | ||
contentType: swears | ||
title: Voi vittu, Git!?! | ||
--- |
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 @@ | ||
<aside class="notice">Hei! Saat nämä samat ohjeet ilman kirosanoja osoitteesta <a href="{{site.url_noswears}}/{{locale}}">dangitgit.com</a></aside> |
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,5 @@ | ||
<footer> | ||
<small class="contact"> Mikä on sun 'Voi vittu, git' kokemus? Jaa se!</small> | ||
<small class="twitter">{% twitter_link "ohshitgit" %} {% twitter_link "ksylor" %}</small> | ||
<small class="copyright">{{site.copyright | safe}}</small> | ||
</footer> |
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,3 @@ | ||
<p>Git on vaikea ohjelma: mokaaminen on helppoa, ja sen keksiminen miten virheet korjataan, on jumalauta mahdotonta. Git:in dokumentaatioon turvautuminen on varsinainen muna-kana-ongelma: et voi hakea korjausta sotkuusi <em>ellet tiedä jo tiedä sitä termiä jota olet etsimässä</em> jotta saat ongelmasi ratkaistua.</p> | ||
|
||
<p>Tässä on jotain esimerkkejä niistä tilanteista joihin olen joutunut, ja ohjeet <em>selkellä suomella</em> siitä miten sain itseni niistä ulos.</p> |
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 @@ | ||
<p>*Huomio: Tämän sivuston ei ole tarkoitus olla tyhjentävä dokumentaatio. Ja kyllä, on olemassa tapoja tehdä nämä samat asiat teoreettisesti puhtaammin tai jollain muulla tavalla, mutta monen yrityksen ja erehdyksen jälkeen, kiroillen ja heittäen pöytiä, olen todennut näiden ohjeiden toimivan. Sain hullun päähänpiston jakaa ne maailmalle sopivan kevytmielisesti ja kirosanoilla höystettynä. Ota tai jätä!</p> |
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,4 @@ | ||
<p>Kiitos paljon seuraaville henkilöille, jotka ovat vapaaehtoisesti kääntäneet tämän sivuston eri kielille! Olette upeita! | ||
{% include "partials/collaborator-list.njk" %}. Mukana ovat myös olleet {% include "partials/otherhelper-list.njk" %}</p> | ||
|
||
<p>Jos haluat auttaa tämän sivuston kääntämisessä, tee PR täällä {% github_link %}</p> |
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,18 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, tein jotain väärin, kai tässä ohjelmassa on joku aikakone!?! | ||
id: magic-time-machine | ||
order: 1 | ||
--- | ||
|
||
```git | ||
git reflog | ||
# näet listan kaikesta mitä olet | ||
# tehnyt git:ssä kaikissa haaroissa! | ||
# Jokaisella haaralla on indeksi osoitteessa HEAD@{index} | ||
# etsi se kohta jossa kaikki toimi, ennen kuin rikoit kaiken | ||
git reset HEAD@{index} | ||
# maaginen aikakone | ||
``` | ||
|
||
Voit käyttää tätä komentoa saadaksesi takaisin jotain jonka poistit vahingossa, tai siirtääksesi kamaa jota kokeilit ennen kuin rikoit repon, tai toipuaksesi pahasta mergestä, tai muuten vaan palataksesi kohtaan jossa asiat oikeasti toimivat. Käytän `reflog`-komentoa PALJON. Iso hatunnosto niille monille monille monille monille monille ihmisille, jotka ehdottivat tämän komennon lisäämistä! |
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,18 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, tein commitin ja huomasin heti että pitää tehdä vielä yksi muutos! | ||
id: change-last-commit | ||
order: 2 | ||
--- | ||
|
||
```git | ||
# tee tarvitsemasi muutos | ||
git add . # tai lisää yksittäiset tiedostot | ||
git commit --amend --no-edit | ||
# nyt viimeisin committisi sisältää sen muutoksen! | ||
# VAROITUS! älä ikinä käytä --amend komentoa julkisille commiteille | ||
``` | ||
|
||
Tämä tapahtuu usein kun ajan testejä ja linttereitä... ja jumalauta, silloin kun unohdan laittaa välimerkin yhtäsuuruusmerkin perään. Saman muutoksen voisi tehdä omana committinaan ja sitten ajaa komennon `rebase -i` jotta puristat commitit yhteen, mutta tämä on miljoona kertaa nopeampaa. | ||
|
||
*Varoitus: Älä ikinä käytä amend-komentoa commiteille jotka on jo puskettu julkiseen/jaettuun haaraan! Käytä amend-komentoa vain muutoksiin jotka ovat lokaalissa ympäristössäsi tai muuten tulee ongelmia.* |
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,12 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, haluan muuttaa edellisen commitin viestiä! | ||
id: change-last-commit-message | ||
order: 3 | ||
--- | ||
```git | ||
git commit --amend | ||
# seuraa ohjeita commit-viestin muokkaamiseen | ||
``` | ||
|
||
Typerät commit-viestin muotoiluvaatimukset. |
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,16 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, committasin päähaaraan jotain jonka olisi pitänyt olla toisessa haarassa! | ||
id: accidental-commit-master | ||
order: 4 | ||
--- | ||
|
||
```git | ||
# luodaan uusi haara päähaaran nykyisestä tilasta | ||
git branch uuden-haaran-nimi | ||
# poistetaan uusin commit päähaarasta | ||
git reset HEAD~ --hard | ||
git checkout uuden-haaran-nimi | ||
# uusin committisi on nyt uudessa haarassa :) | ||
``` | ||
Huomio: tämä ei toimi jos olet jo puskenut muutokset julkiseen/jaettuun haaraan, ja jos olet kokeillut jo muita temppuja, voi olla että joudut käyttämään komentoa `git reset HEAD@{näin-monta-committia-taaksepäin}` komennon `HEAD~` sijaan. Voi surku. Myös, kiitos monille monille monille ihmisille, jotka ehdottivat upen tavan tehdä tämän lyhyemmin kuin mitä itse käytin. Kiitos teille! |
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,29 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, commitoin vahingossa väärään haaraan! | ||
id: accidental-commit-wrong-branch | ||
order: 5 | ||
--- | ||
|
||
```git | ||
# perutaan uusin commit, mutta jätetään muutokset saataville | ||
git reset HEAD~ --soft | ||
git stash | ||
# siirrytään oikeaan haaraan | ||
git checkout name-of-the-correct-branch | ||
git stash pop | ||
git add . # tai lisää yksittäisiä tiedostoja | ||
git commit -m "viestisi tähän" | ||
# nyt muutoksesi ovat oikeassa haarassa | ||
``` | ||
|
||
Monet ihmiset ovat ehdottaneet `cherry-pick`-komennon käyttämistä tässä tilanteessa, joten voit käyttää sitäkin valitaksesi mitkä muutokset haluat! | ||
|
||
```git | ||
git checkout oikean-haaran-nimi | ||
# napataan uusin commit päähaaraan | ||
git cherry-pick master | ||
# poistetaan se päähaarasta | ||
git checkout master | ||
git reset HEAD~ --hard | ||
``` |
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,14 @@ | ||
--- | ||
tags: tip | ||
title: Voi vittu, yritin ajaa `diff`-komennon, mutta tuloste on tyhjä?! | ||
id: dude-wheres-my-diff | ||
order: 6 | ||
--- | ||
|
||
Jos tiedät että olet tehnyt muutoksia tiedostoihin, muuta `diff`-komennon tuloste näyttää tyhjää, olet luultavasti siirtänyt tiedostot jo `add`-komentolla valmistelualueelle (staging), ja nähdäkseksesi muutokset, joudut lisäämään erityisen option. | ||
|
||
```git | ||
git diff --staged | ||
``` | ||
|
||
Sarjassamme omituista ¯\\\_(ツ)\_/¯ (ja kyllä, tiedän että tämä on toiminnallisuus, ei virhetilanne, mutta se on vitun hämmentävää ja saatanan epäintuitiivista kun törmäät tähän ensimmäisen kerran!) |
Oops, something went wrong.