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: en/deploy/README.md
+24-6Lines changed: 24 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -29,9 +29,27 @@ Initialized empty Git repository in ~/djangogirls/.git/
29
29
$ git config --global user.name "Your Name"
30
30
$ git config --global user.email you@example.com
31
31
```
32
-
33
32
Initializing the git repository is something we need to do only once per project (and you won't have to re-enter the username and email ever again).
34
33
34
+
### Adjusting your branch name
35
+
36
+
If the version of Git that you are using is older than **2.28**, you will need to change the name of your branch to "main". To determine the version of Git, please enter the following command:
37
+
38
+
{% filename %}command-line{% endfilename %}
39
+
```
40
+
$ git --version
41
+
git version 2.xx...
42
+
```
43
+
44
+
Only if the second number of the version, shown as "xx" above, is less than 28, will you need to enter the following command to rename your branch. If it is 28 or higher, please continue to "Ignoring files". As in "Initializing", this is something we need to do only once per project, as well as only when your version of Git is less than 2.28:
45
+
46
+
{% filename %}command-line{% endfilename %}
47
+
```
48
+
$ git branch -M main
49
+
```
50
+
51
+
### Ignoring files
52
+
35
53
Git will track changes to all the files and folders in this directory, but there are some files we want it to ignore. We do this by creating a file called `.gitignore` in the base directory. Open up your editor and create a new file with the following contents:
36
54
37
55
{% filename %}.gitignore{% endfilename %}
@@ -84,7 +102,7 @@ It's a good idea to use a `git status` command before `git add` or whenever you
84
102
{% filename %}command-line{% endfilename %}
85
103
```
86
104
$ git status
87
-
On branch master
105
+
On branch main
88
106
89
107
No commits yet
90
108
@@ -130,12 +148,12 @@ On the next screen, you'll be shown your repo's clone URL, which you will use in
130
148
131
149
Now we need to hook up the Git repository on your computer to the one up on GitHub.
132
150
133
-
Type the following into your console (replace `<your-github-username>` with the username you entered when you created your GitHub account, but without the angle-brackets -- the URL should match the clone URL you just saw):
151
+
Type the following into your console (replace `<your-github-username>` with the username you entered when you created your GitHub account, but without the angle-brackets -- the URL should match the clone URL you just saw).
When you push to GitHub, you'll be asked for your GitHub username and password (either right there in the command-line window or in a pop-up window), and after entering credentials you should see something like this:
Copy file name to clipboardExpand all lines: en/deploy/install_git.md
+31Lines changed: 31 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -7,6 +7,8 @@ data-collapse=true ces-->
7
7
8
8
You can download Git from [git-scm.com](https://git-scm.com/). You can hit "next" on all steps except for two: in the step where it asks to choose your editor, you should pick Nano, and in the step entitled "Adjusting your PATH environment", choose "Use Git and optional Unix tools from the Windows Command Prompt" (the bottom option). Other than that, the defaults are fine. Checkout Windows-style, commit Unix-style line endings is good.
9
9
10
+
During installation, if you are presented with the option of "Adjusting the name of the initial branch in new repositories", please choose to "Override the default" and use "main". This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.
11
+
10
12
Do not forget to restart the command prompt or PowerShell after the installation finished successfully.
11
13
<!--endsec-->
12
14
@@ -15,6 +17,8 @@ data-collapse=true ces-->
15
17
16
18
Download Git from [git-scm.com](https://git-scm.com/) and follow the instructions.
17
19
20
+
During installation, if you are presented with the option of "Adjusting the name of the initial branch in new repositories", please choose to "Override the default" and use "main". This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.
21
+
18
22
> **Note** If you are running OS X 10.6, 10.7, or 10.8, you will need to install the version of git from here: [Git installer for OS X Snow Leopard](https://sourceforge.net/projects/git-osx-installer/files/git-2.3.5-intel-universal-snow-leopard.dmg/download)
19
23
20
24
<!--endsec-->
@@ -27,6 +31,15 @@ data-collapse=true ces-->
27
31
$ sudo apt install git
28
32
```
29
33
34
+
### Adjusting your default branch name
35
+
36
+
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.
37
+
38
+
{% filename %}command-line{% endfilename %}
39
+
```
40
+
$ git config --global --add init.defaultBranch main
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.
56
+
57
+
{% filename %}command-line{% endfilename %}
58
+
```
59
+
$ git config --global --add init.defaultBranch main
This will align your installation of Git with the broad direction of the global developer community, and the "main" branch will be used through the remainder of this tutorial. Please see https://sfconservancy.org/news/2020/jun/23/gitbranchname/ and https://github.com/github/renaming for further discussion of this subject.
75
+
76
+
{% filename %}command-line{% endfilename %}
77
+
```
78
+
$ git config --global --add init.defaultBranch main
0 commit comments