You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+3-3
Original file line number
Diff line number
Diff 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
43
43
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:
44
44
45
45
- 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.
48
48
- 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)
50
50
- Open a pull request against the `main` branch of this repository.
51
51
- Be sure to @ mention a couple of your friends who are native speakers and ask them to review the translation.
52
52
- Update your translation based on feedback from your friends.
git subtree add --prefix=submodulo-ejemplo https://github.com/githubtraining/submodulo-ejemplo main --squash
30
30
31
31
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.
32
32
@@ -45,9 +45,10 @@ El comando `subtree add` agrega un subdirectorio que contiene los archivos de `s
45
45
</div>
46
46
47
47
{% capture submodule %}
48
+
48
49
### Submódulo
49
50
50
-
Para ver las diferencias (`diff`) de un submódulo:
51
+
Para ver las diferencias (`diff`) de un submódulo:
51
52
52
53
```bash
53
54
# mostrar cambios al commit del submódulo
@@ -81,6 +82,7 @@ No se requiere ningún comando especial
81
82
</div>
82
83
83
84
{% capture submodule %}
85
+
84
86
### Submódulo
85
87
86
88
Para clonar un repositorio junto con su submódulo:
@@ -116,10 +118,11 @@ No se requiere ningún comando especial
116
118
</div>
117
119
118
120
{% capture submodule %}
121
+
119
122
### Submódulo
120
123
121
124
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`:
123
126
124
127
```bash
125
128
git pull
@@ -164,13 +167,13 @@ No se requiere ningún comando especial
164
167
</div>
165
168
166
169
{% capture submodule %}
167
-
### Submódulo
168
170
171
+
### Submódulo
169
172
170
173
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`:
172
175
173
-
```bash
176
+
```bash
174
177
git checkout <branch>
175
178
git submodule update --recursive
176
179
# o, en un comando (Git >= 2.13)
@@ -200,6 +203,7 @@ No se requiere ningún comando especial
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.
213
217
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.
215
219
216
220
Se puede cambiar la rama predeterminada para futuras llamadas con:
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):
Copy file name to clipboardExpand all lines: downloads/github-git-concepts_BETA.md
+25-18
Original file line number
Diff line number
Diff line change
@@ -7,35 +7,41 @@ Git is an open source, distributed version control system founded in command lin
7
7
With a language all its own, this quick guide to common terms of GitHub and Git will have you collaborating in no time.
8
8
9
9
### Repository
10
+
10
11
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.
11
12
12
13
### Commit
14
+
13
15
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.
14
16
15
17
### 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.
17
20
18
21
### Remote
22
+
19
23
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.
20
24
21
25
### Pull Request
26
+
22
27
A feature on GitHub which provides conversation, line-by-line code review, change history analysis, and summaries of modified files.
23
28
24
29
## Configuring
30
+
25
31
The first thing to setup when using Git is two important fields about the user. This allows appropriate credit and traceability for project contributions.
26
32
27
33
```
28
-
$ git config --global user.name "Mona Lisa Octocat"
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.
35
41
36
42
```
37
-
$ git clone [url] [project-name]
38
-
$ cd [project-name]
43
+
git clone [url] [project-name]
44
+
cd [project-name]
39
45
```
40
46
41
47
Repository contributions are commonly made through branches and commits focused on small pieces of work.
@@ -50,7 +56,7 @@ git commit -m [commit message]
50
56
When the feature work reaches completion, the branch can be merged locally or pushed to GitHub for code review.
51
57
52
58
```
53
-
git switch master
59
+
git switch main
54
60
git merge [branch]
55
61
56
62
git push -u origin [branch]
@@ -59,43 +65,44 @@ git push -u origin [branch]
59
65
As commits can be efficiently made, the state of any new, modified, or missing files can be verified and quickly validated.
60
66
61
67
```
62
-
$ git status
63
-
$ git diff [modified-file]
68
+
git status
69
+
git diff [modified-file]
64
70
```
65
71
66
72
## 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.
68
75
69
76
```
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
73
80
```
74
81
75
82
[PLACEHOLDER - Recursive Merge Diagram]
76
83
77
84
The last step deletes the branch. Merges result in all commit history becoming traversible, and eliminating the need for the branch label to remain.
78
85
79
-
80
86
## Sharing & Retrieving
87
+
81
88
Sharing commit history requires only a destination repository, one on GitHub, and a single setup step.
82
89
83
90
```
84
-
$ git remote add origin [repo-url]
85
-
$ git remote -v
91
+
git remote add origin [repo-url]
92
+
git remote -v
86
93
```
87
94
88
95
[PLACEHOLDER - Local-Upstream Diagram]
89
96
90
97
With a remote setup, and the traditional name of "origin" aliased to the URL, publishing local commits is simple.
91
98
92
99
```
93
-
$ git push origin [branch-name]
100
+
git push origin [branch-name]
94
101
```
95
102
96
103
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.
0 commit comments