nuove pagine
This commit is contained in:
parent
6376a5b548
commit
5dc5016515
|
|
@ -0,0 +1,67 @@
|
|||
---
|
||||
id: c2
|
||||
sidebar_position: 1
|
||||
title: Git da riga di comando in Visual Studio
|
||||
sidebar_label: Git VsCode 1
|
||||
---
|
||||
|
||||
|
||||
# 🖼️ Git da riga di comando in Visual Studio
|
||||
|
||||
|
||||
---
|
||||
|
||||
## 🟢 Staging & Commit
|
||||
|
||||
| Comando | Descrizione | Esempio |
|
||||
|---------|------------|---------|
|
||||
| ➕ `git add <file>` | Aggiunge file allo staging | `git add main.py`<br />`git add .` |
|
||||
| ✏️ `git commit -m "msg"` | Salva le modifiche nello storico | `git commit -m "Aggiunto modulo login"` |
|
||||
| 🧹 `git reset <file>` | Rimuove file dallo staging | `git reset main.py` |
|
||||
| 🧩 `git checkout -- <file>` | Annulla modifiche non committate | `git checkout -- main.py` |
|
||||
|
||||
---
|
||||
|
||||
## 🔵 Branch & Merge
|
||||
|
||||
| Comando | Descrizione | Esempio |
|
||||
|---------|------------|---------|
|
||||
| 🌿 `git branch <nome>` | Crea un nuovo branch | `git branch feature/login` |
|
||||
| 🌿 `git checkout <branch>` | Passa a un branch esistente | `git checkout feature/login` |
|
||||
| 🌿 `git checkout -b <branch>` | Crea e passa a un nuovo branch | `git checkout -b feature/signup` |
|
||||
| 🔄 `git merge <branch>` | Unisce un branch nel branch corrente | `git merge feature/login` |
|
||||
|
||||
---
|
||||
|
||||
## 🟠 Remoto
|
||||
|
||||
| Comando | Descrizione | Esempio |
|
||||
|---------|------------|---------|
|
||||
| 🔗 `git remote add origin <URL>` | Collega repository locale a remoto | `git remote add origin https://github.com/user/repo.git` |
|
||||
| 🚀 `git push origin <branch>` | Invia commit al repository remoto | `git push origin main` |
|
||||
| ⬇️ `git pull origin <branch>` | Scarica modifiche dal remoto | `git pull origin main` |
|
||||
| 🔍 `git remote -v` | Mostra repository remoti collegati | `git remote -v` |
|
||||
|
||||
---
|
||||
|
||||
## 🟣 Info & Config
|
||||
|
||||
| Comando | Descrizione | Esempio |
|
||||
|---------|------------|---------|
|
||||
| 📜 `git log` | Mostra cronologia dei commit | `git log`<br />`git log --oneline` |
|
||||
| ⚙️ `git config --global user.name "Nome"` | Imposta nome autore | `git config --global user.name "Mario Rossi"` |
|
||||
| ⚙️ `git config --global user.email "email"` | Imposta email autore | `git config --global user.email "mario@example.com"` |
|
||||
| 📂 `git init` | Inizializza un repository locale | `git init` |
|
||||
|
||||
---
|
||||
|
||||
## 💡 Suggerimenti rapidi
|
||||
|
||||
- 🟢 **Staging / Commit** → commit frequenti
|
||||
- 🔵 **Branch / Merge** → lavora sempre su branch separati
|
||||
- 🟠 **Remoto** → pull prima di push
|
||||
- 🟣 **Info / Config** → controlla sempre lo stato con `git status`
|
||||
|
||||
---
|
||||
|
||||
> 🔗 Risorse utili: [Git Documentation](https://git-scm.com/doc)
|
||||
|
|
@ -0,0 +1,93 @@
|
|||
---
|
||||
id: c3
|
||||
sidebar_position: 2
|
||||
title: Git Passo-Passo per Principianti
|
||||
sidebar_label: Git Facile
|
||||
---
|
||||
|
||||
# 🐣 Git Passo-Passo per Principianti
|
||||
|
||||
> 🎨 Versione guidata per chi parte da zero
|
||||
> 💡 L’obiettivo: lavorare sempre su branch separati e non rompere il repository principale
|
||||
|
||||
---
|
||||
|
||||
## 1️⃣ Clona il repository (se non l’hai già)
|
||||
|
||||
Prima di iniziare a modificare, devi avere il repository sul tuo computer.
|
||||
|
||||
```csharp
|
||||
git clone [URL-DEL-REPOSITORY]
|
||||
cd [NOME-REPO]
|
||||
```
|
||||
🔹 [URL-DEL-REPOSITORY] → indirizzo del repository remoto
|
||||
🔹 [NOME-REPO] → la cartella del progetto
|
||||
|
||||
2️⃣ Controlla lo stato del repository
|
||||
```csharp
|
||||
git status
|
||||
```
|
||||
Ti mostra quali file sono stati modificati e se ci sono modifiche non salvate.
|
||||
|
||||
3️⃣ Crea un nuovo branch
|
||||
Sempre creare un branch nuovo per ogni modifica!
|
||||
Così il branch principale (main o master) rimane sicuro.
|
||||
|
||||
```csharp
|
||||
git checkout -b feature/nome-modifica
|
||||
```
|
||||
🔹 Usa un nome chiaro, es: feature/login
|
||||
|
||||
4️⃣ Modifica i file
|
||||
Fai le modifiche necessarie nei file del progetto.
|
||||
|
||||
5️⃣ Aggiungi i file allo staging
|
||||
```csharp
|
||||
git add <file>
|
||||
```
|
||||
🔹 [file] → il file specifico che vuoi salvare
|
||||
🔹 Usa . per aggiungere tutti i file modificati
|
||||
|
||||
6️⃣ Salva le modifiche con un commit
|
||||
```csharp
|
||||
git commit -m "Messaggio chiaro sulla modifica"
|
||||
```
|
||||
🔹 Usa un messaggio chiaro: es. Aggiunto modulo login o Corretto bug funzione X
|
||||
|
||||
7️⃣ Aggiorna il branch remoto
|
||||
Prima di inviare le modifiche, assicurati di avere l’ultima versione del repository remoto:
|
||||
|
||||
```csharp
|
||||
git pull origin main
|
||||
```
|
||||
Poi invia il tuo branch:
|
||||
|
||||
```csharp
|
||||
git push origin feature/nome-modifica
|
||||
```
|
||||
8️⃣ Apri una Pull Request (PR)
|
||||
🔹 Vai sul repository remoto (GitHub, GitLab, ecc.)
|
||||
🔹 Apri una PR dal tuo branch verso main
|
||||
🔹 Descrivi cosa hai fatto e richiedi revisione
|
||||
|
||||
9️⃣ Dopo che la PR è approvata
|
||||
Torna sul branch principale aggiornato:
|
||||
|
||||
```csharp
|
||||
git checkout main
|
||||
git pull origin main
|
||||
```
|
||||
|
||||
Puoi cancellare il branch locale se non serve più:
|
||||
|
||||
```csharp
|
||||
git branch -d feature/nome-modifica
|
||||
```
|
||||
|
||||
💡 Suggerimenti rapidi
|
||||
✅ Sempre lavorare su un branch nuovo
|
||||
✅ Commit frequenti e chiari
|
||||
✅ Pull prima di push
|
||||
✅ Controlla sempre git status
|
||||
|
||||
🔗 Risorse utili: [Git Documentation](https://git-scm.com/doc)
|
||||
|
|
@ -38,6 +38,10 @@ const config: Config = {
|
|||
[
|
||||
"classic",
|
||||
{
|
||||
theme: {
|
||||
customCss: "./src/css/custom.css",
|
||||
},
|
||||
|
||||
docs: {
|
||||
sidebarPath: "./sidebars.ts",
|
||||
// Please change this to your repo.
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load Diff
|
|
@ -4,18 +4,24 @@
|
|||
* work well for content-centric websites.
|
||||
*/
|
||||
|
||||
/* You can override the default Infima variables here. */
|
||||
/* Import Roboto da Google Fonts */
|
||||
@import url('https://fonts.googleapis.com/css2?family=Roboto:wght@400;500;700&display=swap');
|
||||
|
||||
html, body {
|
||||
/* You can override the default Infima variables here. */
|
||||
html,
|
||||
body {
|
||||
height: 100%;
|
||||
margin: 0;
|
||||
font-family: 'Roboto', sans-serif;
|
||||
/* Forza Roboto */
|
||||
}
|
||||
|
||||
main {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 auto;
|
||||
min-height: 0; /* prevents flex child overflow */
|
||||
min-height: 0;
|
||||
/* prevents flex child overflow */
|
||||
}
|
||||
|
||||
:root {
|
||||
|
|
@ -28,6 +34,10 @@ main {
|
|||
--ifm-color-primary-lightest: #3cad6e;
|
||||
--ifm-code-font-size: 95%;
|
||||
--docusaurus-highlighted-code-line-bg: rgba(0, 0, 0, 0.1);
|
||||
|
||||
/* Override Infima font variable */
|
||||
--ifm-font-family-base: 'Roboto', sans-serif;
|
||||
--ifm-font-family-monospace: 'Roboto Mono', monospace;
|
||||
}
|
||||
|
||||
/* For readability concerns, you should choose a lighter palette in dark mode. */
|
||||
|
|
|
|||
Loading…
Reference in New Issue