Skip to content

Commit b48e26d

Browse files
authored
mastermain
1 parent 495af61 commit b48e26d

4 files changed

+69
-45
lines changed

CONTRIBUTING.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,10 +43,10 @@ If you aren't sure how to fix it or just don't have time, we invite you to open
4343
Several community members have been kind enough to translate the Git Cheat Sheets into various languages. At this time, we are only set up to serve the cheat sheets in various languages (but maybe you can help us change that 😉). If you are planning to contribute a translation, please do the following:
4444

4545
- Fork this repository
46-
- Create a new folder in the [downloads directory](https://github.com/github/training-kit/tree/master/downloads) using the standard abbreviation for the language you are providing.
47-
- Copy the most recent [English version of the cheat sheet](https://github.com/github/training-kit/blob/master/downloads/github-git-cheat-sheet.md) to the folder you created.
46+
- Create a new folder in the [downloads directory](https://github.com/github/training-kit/tree/main/downloads) using the standard abbreviation for the language you are providing.
47+
- Copy the most recent [English version of the cheat sheet](https://github.com/github/training-kit/blob/main/downloads/github-git-cheat-sheet.md) to the folder you created.
4848
- Complete the translation
49-
- Add a link to the translated resource on [/index.html](https://github.com/github/training-kit/blob/master/index.html)
49+
- Add a link to the translated resource on [/index.html](https://github.com/github/training-kit/blob/main/index.html)
5050
- Open a pull request against the `main` branch of this repository.
5151
- Be sure to @ mention a couple of your friends who are native speakers and ask them to review the translation.
5252
- Update your translation based on feedback from your friends.

downloads/es_ES/submodule-vs-subtree-cheat-sheet.md

+23-15
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ leadingpath: ../../
1111
</div>
1212

1313
{% capture submodule %}
14+
1415
### Submódulo
1516

1617
git submodule add https://github.com/githubtraining/submodulo-ejemplo
@@ -25,8 +26,7 @@ El comando `submodule add` agrega un nuevo archivo llamado `.gitmodules` junto c
2526

2627
### Subárbol
2728

28-
29-
git subtree add --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo master --squash
29+
git subtree add --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo main --squash
3030

3131
El comando `subtree add` agrega un subdirectorio que contiene los archivos de `submodulo-ejemplo`. La práctica más común es utilizar la opción `--squash` para combinar el historial del subproyecto en un único commit, que luego se inserta en el árbol existente del proyecto principal. Se puede omitir la opción `--squash` para mantener todo el historial de la rama seleccionada del subproyecto.
3232

@@ -45,9 +45,10 @@ El comando `subtree add` agrega un subdirectorio que contiene los archivos de `s
4545
</div>
4646

4747
{% capture submodule %}
48+
4849
### Submódulo
4950

50-
Para ver las diferencias (`diff`) de un submódulo:
51+
Para ver las diferencias (`diff`) de un submódulo:
5152

5253
```bash
5354
# mostrar cambios al commit del submódulo
@@ -81,6 +82,7 @@ No se requiere ningún comando especial
8182
</div>
8283

8384
{% capture submodule %}
85+
8486
### Submódulo
8587

8688
Para clonar un repositorio junto con su submódulo:
@@ -116,10 +118,11 @@ No se requiere ningún comando especial
116118
</div>
117119

118120
{% capture submodule %}
121+
119122
### Submódulo
120123

121124
De forma predeterminada, el repositorio del submódulo se recupera, pero no se actualiza cuando ejecuta `git pull` en el superproyecto.
122-
Se necesita usar `git submodule update`, o agregar ` --recurse-submodules` a `pull`:
125+
Se necesita usar `git submodule update`, o agregar `--recurse-submodules` a `pull`:
123126

124127
```bash
125128
git pull
@@ -164,13 +167,13 @@ No se requiere ningún comando especial
164167
</div>
165168

166169
{% capture submodule %}
167-
### Submódulo
168170

171+
### Submódulo
169172

170173
De forma predeterminada, el árbol de trabajo del submódulo no se actualiza para que coincida con el commit registrado en el superproyecto al cambiar de rama.
171-
Necesita usar `git submodule update`, o agregar` --recurse-submodules` a `checkout`:
174+
Necesita usar `git submodule update`, o agregar`--recurse-submodules` a `checkout`:
172175

173-
```bash
176+
```bash
174177
git checkout <branch>
175178
git submodule update --recursive
176179
# o, en un comando (Git >= 2.13)
@@ -200,6 +203,7 @@ No se requiere ningún comando especial
200203
</div>
201204

202205
{% capture submodule %}
206+
203207
### Submódulo
204208

205209
```bash
@@ -211,7 +215,7 @@ git commit -am "Update submodule"
211215

212216
Si tiene más de un submódulo, puede agregar la ruta al submódulo al final del comando `git submodule update --remote` para especificar qué subproyecto actualizar.
213217

214-
Por defecto, `git submodule update --remote` actualizará el submódulo al último commit en la rama` master` del submódulo remoto.
218+
Por defecto, `git submodule update --remote` actualizará el submódulo al último commit en la rama`main` del submódulo remoto.
215219

216220
Se puede cambiar la rama predeterminada para futuras llamadas con:
217221

@@ -227,13 +231,14 @@ git config -f .gitmodules submodule.example-submodule.branch otra-rama
227231
{% capture subtree %}
228232

229233
### Subárbol
230-
git subtree pull --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo master --squash
234+
235+
git subtree pull --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo main --squash
231236

232237
Se puede acortar el comando agregando la URL del subárbol como remoto:
233-
238+
234239
git remote add sub-remote https://github.com/githubtraining/submodulo-ejemplo.git
235240

236-
Se pueden utilizar los commandos add/pull de otras referencias reemplazando `master` con la referencia deseada (e.g. `stable`, `v1.0`).
241+
Se pueden utilizar los commandos add/pull de otras referencias reemplazando `main` con la referencia deseada (e.g. `stable`, `v1.0`).
237242

238243
{% endcapture %}
239244

@@ -252,12 +257,13 @@ Cuando esto no sea práctico, siga estas instrucciones:
252257
</div>
253258

254259
{% capture submodule %}
260+
255261
### Submódulo
256262

257263
Acceda al directorio del submódulo y cree una rama:
258264

259265
cd example-submodule
260-
git checkout -b nombre-rama master
266+
git checkout -b nombre-rama main
261267

262268
Los cambios requieren dos commits, una en el repositorio del subproyecto y otra en el repositorio principal.
263269
¡No olvides agregar tanto el submódulo como el superproyecto!
@@ -286,6 +292,7 @@ Es posible crear commits mezclando cambios en el subproyecto y el proyecto princ
286292
</div>
287293

288294
{% capture submodule %}
295+
289296
### Submódulo
290297

291298
Mientras está en el directorio del submódulo:
@@ -301,7 +308,8 @@ O mientras está en el directorio principal:
301308
{% capture subtree %}
302309

303310
### Subárbol
304-
git subtree push --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo master
311+
312+
git subtree push --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo main
305313
{% endcapture %}
306314

307315
<div class="col-md-6">
@@ -324,11 +332,11 @@ Muestre un breve resumen de los cambios del submódulo en su mensaje `git status
324332

325333
git config --global status.submoduleSummary true
326334

327-
Haga que `push` sea predeterminado en` --recurse-submodules = on-demand`:
335+
Haga que `push` sea predeterminado en `--recurse-submodules = on-demand`:
328336

329337
git config --global push.recurseSubmodules on-demand
330338

331-
Haga que todos los comandos (excepto `clone`) estén predeterminados en` --recurse-submodules` si admiten la bandera (esto funciona para `git pull` desde Git 2.15):
339+
Haga que todos los comandos (excepto `clone`) estén predeterminados en `--recurse-submodules` si admiten la bandera (esto funciona para `git pull` desde Git 2.15):
332340

333341
git config --global submodule.recurse true
334342

downloads/github-git-concepts_BETA.md

+25-18
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,41 @@ Git is an open source, distributed version control system founded in command lin
77
With a language all its own, this quick guide to common terms of GitHub and Git will have you collaborating in no time.
88

99
### Repository
10+
1011
A repository is the most basic element of Git and GitHub. Imagine it as a project's folder. A repository contains all of the project files (including documentation), and stores each file's revision history.
1112

1213
### Commit
14+
1315
An individual change to a file (or set of files). With Git, every time you save it creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep record of what changes were made when and by who. Commits usually contain a commit message which is a brief description the changes made.
1416

1517
### Branch
16-
A parallel version of repository. It is contained within the repository, but does not affect the primary or master branch allowing you to work freely without disrupting the "live" version.
18+
19+
A parallel version of repository. It is contained within the repository, but does not affect the main branch, allowing you to work freely without disrupting the "live" version.
1720

1821
### Remote
22+
1923
The connection of a local repository with one on GitHub. It permits revision history to be synchronized by publishing local commits and downloading any new changes from GitHub.
2024

2125
### Pull Request
26+
2227
A feature on GitHub which provides conversation, line-by-line code review, change history analysis, and summaries of modified files.
2328

2429
## Configuring
30+
2531
The first thing to setup when using Git is two important fields about the user. This allows appropriate credit and traceability for project contributions.
2632

2733
```
28-
$ git config --global user.name "Mona Lisa Octocat"
29-
$ git config --global user.email "[email protected]"
34+
git config --global user.name "Mona Lisa Octocat"
35+
git config --global user.email "[email protected]"
3036
```
3137

3238
## Versioning Files
3339

3440
Versioning files begins by creating a repository on your GitHub account. File authoring and editing can be performed through the web interface or by acquiring the repository locally from the command line.
3541

3642
```
37-
$ git clone [url] [project-name]
38-
$ cd [project-name]
43+
git clone [url] [project-name]
44+
cd [project-name]
3945
```
4046

4147
Repository contributions are commonly made through branches and commits focused on small pieces of work.
@@ -50,7 +56,7 @@ git commit -m [commit message]
5056
When the feature work reaches completion, the branch can be merged locally or pushed to GitHub for code review.
5157

5258
```
53-
git switch master
59+
git switch main
5460
git merge [branch]
5561
5662
git push -u origin [branch]
@@ -59,43 +65,44 @@ git push -u origin [branch]
5965
As commits can be efficiently made, the state of any new, modified, or missing files can be verified and quickly validated.
6066

6167
```
62-
$ git status
63-
$ git diff [modified-file]
68+
git status
69+
git diff [modified-file]
6470
```
6571

6672
## Integrating Changes
67-
Commits can be made against any branch and in any order. Commonly, this is performed against the master branch as means of feature or bug-fix integration.
73+
74+
Commits can be made against any branch and in any order. Commonly, this is performed against the main branch as means of feature or bug-fix integration.
6875

6976
```
70-
$ git switch master
71-
$ git merge feature-enhancement
72-
$ git branch -d feature-enhancement
77+
git switch main
78+
git merge feature-enhancement
79+
git branch -d feature-enhancement
7380
```
7481

7582
[PLACEHOLDER - Recursive Merge Diagram]
7683

7784
The last step deletes the branch. Merges result in all commit history becoming traversible, and eliminating the need for the branch label to remain.
7885

79-
8086
## Sharing & Retrieving
87+
8188
Sharing commit history requires only a destination repository, one on GitHub, and a single setup step.
8289

8390
```
84-
$ git remote add origin [repo-url]
85-
$ git remote -v
91+
git remote add origin [repo-url]
92+
git remote -v
8693
```
8794

8895
[PLACEHOLDER - Local-Upstream Diagram]
8996

9097
With a remote setup, and the traditional name of "origin" aliased to the URL, publishing local commits is simple.
9198

9299
```
93-
$ git push origin [branch-name]
100+
git push origin [branch-name]
94101
```
95102

96103
Retrieving changes from a shared repository and automatically merging in any new commits locally is performed in a multi-step operation run by one command.
97104

98105
```
99-
$ git switch [target-branch]
100-
$ git pull origin [upstream-branch]
106+
git switch [target-branch]
107+
git pull origin [upstream-branch]
101108
```

0 commit comments

Comments
 (0)