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
|| This is the user account, followed by the computer name and separated by an `@`<br><br>Literally: *User **at** Computer*<br> |
63
-
|| Tells us that we are running in MinGW 64 bit<br> |
64
-
|| Shows we are in the `~/Source/Repos` folder, where `~` is the user's (your) home folder.<br><br>In Windows terms, this is the same as:<br><br> `C:\Users\UserName\Source\Repos`<br> |
|| This is the user account, followed by the computer name and separated by an `@`<br><br>Literally: *User **at** Computer*<br>|
67
+
|| Tells us that we are running in MinGW 64 bit<br>|
68
+
|| Shows we are in the `~/Source/Repos` folder, where `~` is the user's (your) home folder.<br><br>In Windows terms, this is the same as:<br><br> `C:\Users\UserName\Source\Repos`<br> |
65
69
66
70
## Setting up Microsoft Terminal to use Git Bash as a CLI
67
71
@@ -97,7 +101,9 @@ Then click the *Browse* button...
97
101
98
102

99
103
100
-
At home, if you have installed using Git-SCM installer then the default location for Git is: `c:\program files\git`. If you have Laragon installed using the default installation location, then you should find Git in the `C:\Laragon\bin\git` folder.
104
+
At home, if you have installed using Git-SCM installer then the default location for Git is: `c:\program files\git`. If
105
+
you have Laragon installed using the default installation location, then you should find Git in the `C:\Laragon\bin\git`
106
+
folder.
101
107
102
108
> At TAFE, we have a different location, `c:\ProgramData\git` or even `C:\ProgramData\Laragon\bin\git`.
103
109
@@ -107,8 +113,8 @@ Use the browse to locate the folder and find either the `git.exe` or the `bash.e
107
113
108
114
Click on the Starting Directory `v` and then untick the "*Use parent process directory*"...
109
115
110
-

111
-
This should then show `%USERPROFILE%` in a text field and `Browse` button underneath...
116
+

117
+
This should then show `%USERPROFILE%` in a text field and `Browse` button underneath...
112
118
113
119

114
120
@@ -121,7 +127,8 @@ No matter what is shown, clear the content and enter the following in its place.
121
127
Click `SAVE` to save the changes
122
128
123
129
### Visual flair (optional)
124
-
You may optionally customise the appearance of the terminal.
130
+
131
+
You may optionally customise the appearance of the terminal.
125
132
126
133
Adrian tends to do this to visually identify the various prompts.
127
134
@@ -140,15 +147,16 @@ Here are the settings Adrian has for this terminal prompt:
140
147
Click Save then you can click the `X` next to settings to close the dialog.
141
148

142
149
143
-
Finally you are able to open the new terminal by clicking on the `v` and selecting your custom terminal or using the short-cut it shows on the right next to your custom terminal.
150
+
Finally you are able to open the new terminal by clicking on the `v` and selecting your custom terminal or using the
151
+
short-cut it shows on the right next to your custom terminal.
144
152
145
153

146
154
147
155
You will now have your terminal open and ready:
148
156
149
157

150
158
151
-
152
159
# Advanced Users
153
160
154
-
If you want to make your CLI look even cooler (more useful) then something like OhMyPosh (https://ohmyposh.dev/) may help.
161
+
If you want to make your CLI look even cooler (more useful) then something like OhMyPosh (https://ohmyposh.dev/) may
Copy file name to clipboardExpand all lines: docs/03-repositories-and-folders.md
+7-2Lines changed: 7 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,20 +16,25 @@ Select the *Command Prompt* option
16
16
17
17
When the terminal opens use the following commands to change into your "user home" and make the `Source\Repos` folder.
18
18
19
-
> **Important:** We tend to use the forward slash `/` in notes as they show up easily, plus most operating systems other than Windows use the `/` as the folder separator.
20
-
>
19
+
> **Important:** We tend to use the forward slash `/` in notes as they show up easily, plus most operating systems other
20
+
> than Windows use the `/` as the folder separator.
21
+
>
21
22
> Later you will see this in action when using the Git command line.
Copy file name to clipboardExpand all lines: docs/04-git-started.md
+11-7Lines changed: 11 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ We are now ready to get started, and create a repository and work with it.
4
4
5
5
## Initialising a Repository for a 'project'
6
6
7
-
There are three main ways to start a project.
7
+
There are three main ways to start a project.
8
8
9
9
Two of them presume you have no existing files to begin with, and the third when you have files in an existing folder.
10
10
@@ -32,7 +32,8 @@ git init .
32
32
33
33

34
34
35
-
The command prompt will now show either `(master)` or `(main)` - if it is `master`, we will show you later how to (a) change it to `main` for the current project and (b) to make `main` the default.
35
+
The command prompt will now show either `(master)` or `(main)` - if it is `master`, we will show you later how to (a)
36
+
change it to `main` for the current project and (b) to make `main` the default.
36
37
37
38
### Option 2: Initialise project and folder at same time
38
39
@@ -51,21 +52,24 @@ cd Duck-Rogers
51
52
52
53
The best part of this is that you are basically able to use the previous options, except the folder already exists.
53
54
54
-
For example, if `Duck-Rogers` already exist and has files, then, if we are at the parent folder for Duck-Rogers we can use the `git init Duck-Rogers` command.
55
+
For example, if `Duck-Rogers` already exist and has files, then, if we are at the parent folder for Duck-Rogers we can
56
+
use the `git init Duck-Rogers` command.
55
57
56
58

57
59
58
-
If you are in the `Duck-Rogers` folder and there are files in the folder then using the `git init .` command will do the same thing.
60
+
If you are in the `Duck-Rogers` folder and there are files in the folder then using the `git init .` command will do the
61
+
same thing.
59
62
60
63

61
64
62
-
63
65
## Verify Repository was Created
64
66
65
67
To check it is created we use the `ls -la` command:
66
68
67
69

68
70
69
-
Notice the last line. The `d` at the start tells you it is a folder (directory), and its name is `.git`. It is a hidden folder.
71
+
Notice the last line. The `d` at the start tells you it is a folder (directory), and its name is `.git`. It is a hidden
72
+
folder.
70
73
71
-
All tracking of changes are then stored in the `.git` folder. If you delete this folder, you delete the whole history of your project.
74
+
All tracking of changes are then stored in the `.git` folder. If you delete this folder, you delete the whole history of
Copy file name to clipboardExpand all lines: docs/05-global-settings.md
+15-15Lines changed: 15 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,10 @@
1
1
## Global configuration changes
2
2
3
-
Git, like any software has many things that can be changed. These area stored in a global configuration file, in a project only configuration file.
3
+
Git, like any software has many things that can be changed. These area stored in a global configuration file, in a
4
+
project only configuration file.
4
5
5
-
Most of the configuration options are able to be set for both, but we show the global (for you as the user) changes you may want to make.
6
+
Most of the configuration options are able to be set for both, but we show the global (for you as the user) changes you
7
+
may want to make.
6
8
7
9
### Git User Name and Email Address
8
10
@@ -18,6 +20,7 @@ The `--global` indicates that the changes are stored for this and all future pro
18
20

19
21
20
22
To see the global settings...
23
+
21
24
```shell
22
25
git config --list --global
23
26
```
@@ -51,28 +54,24 @@ The `--global` indicates that the changes are stored for this and all future pro
51
54
52
55

53
56
54
-
55
57
### Default "Branch" name to Main...
56
58
57
59
To do this for ALL FUTURE projects we use:
58
60
59
61
```bash
60
62
git config --global init.defaultBranch main
61
63
```
64
+
62
65
### Change Current Project's Branch Name
63
66
64
67
To change the current 'master branch' to be the 'main branch' we need to do the following *AFTER* a commit is completed:
68
+
65
69
```bash
66
70
git branch -m master main
67
71
```
68
72
69
73

70
74
71
-
72
-
73
-
74
-
75
-
76
75
### Default Commit Message Editor
77
76
78
77
It is possible to change the code editor for commit messages to something like Notepad.
@@ -89,9 +88,11 @@ To change it to Notepad we would use:
89
88
git config --global core.editor "notepad"
90
89
```
91
90
92
-
> **Important:** when using a GUI editor such as Notepad, you **MUST****SAVE** and **CLOSE** the message, then (usually optionally) **QUIT** the application for the message to be transferred to the git command.
91
+
> **Important:** when using a GUI editor such as Notepad, you **MUST****SAVE** and **CLOSE** the message, then (usually
92
+
> optionally) **QUIT** the application for the message to be transferred to the git command.
93
93
94
-
Now when you enter `git commit` the Notepad editor will open. The command line will tell you it is waiting for the editor to close a file (`COMMIT_MESSAGE`).
94
+
Now when you enter `git commit` the Notepad editor will open. The command line will tell you it is waiting for the
95
+
editor to close a file (`COMMIT_MESSAGE`).
95
96
96
97

97
98
@@ -101,7 +102,8 @@ When Notepad is opened, it will show a set of comments that tell you details abo
101
102
102
103
Now editing the commit message and adding the details that may be more than just a one liner is easy.
103
104
104
-
You then enter the SHORT commit message and, as required, a blank line followed by more details about the changes that have been made to the project.
105
+
You then enter the SHORT commit message and, as required, a blank line followed by more details about the changes that
Copy file name to clipboardExpand all lines: docs/08-status-add-commit.md
+13-12Lines changed: 13 additions & 12 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,6 +5,7 @@ Checking the status of the repository is done using the `git status` command:
5
5
```shell
6
6
git status
7
7
```
8
+
8
9

9
10
10
11
In this example, we have two files that are not "tracked" by the repository.
@@ -18,13 +19,15 @@ To add a file to be tracked we use `git add FILENAME`. For example:
18
19
```shell
19
20
git add ReadMe.md
20
21
```
22
+
21
23

22
24
23
25
Checking the status after adding shows:
24
26
25
27

26
28
27
-
Once a file is tracked, any time you make changes and are happy with them, you should perform a `git status` and then `git add` the changed file.
29
+
Once a file is tracked, any time you make changes and are happy with them, you should perform a `git status` and
30
+
then `git add` the changed file.
28
31
29
32

30
33
@@ -52,11 +55,13 @@ Now our `git status` should show:
52
55
53
56

54
57
55
-
The committed file is still tracked, but as no changes have been made it does not show.
58
+
The committed file is still tracked, but as no changes have been made it does not show.
56
59
57
-
> **Best Practice Hint:** Note in my message, that I included `init:` at the start. This is telling me (and anyone who is on the project) that it is the initialisation of the project.
58
-
>
59
-
> If it is a new feature we use `feat` instead and often would add the feature name in `( )` round brackets. More on this later.
60
+
> **Best Practice Hint:** Note in my message, that I included `init:` at the start. This is telling me (and anyone who
61
+
> is on the project) that it is the initialisation of the project.
62
+
>
63
+
> If it is a new feature we use `feat` instead and often would add the feature name in `( )` round brackets. More on
64
+
> this later.
60
65
61
66
### Exercise
62
67
@@ -84,19 +89,15 @@ feat(readme): Update ReadMe.md to include author and version
84
89
85
90

86
91
87
-
88
-
89
-
90
-
91
-
92
92
### Did you forget `-m` on `git commit`?
93
93
94
94
If you type in `git commit` and do not add the `-m` with the message then the `vi` editor is shown.
95
95
96
96
The easiest way out is to do the following:
97
97
98
98
-**Option 1:** Press **`ESCAPE`** then type **`:qa`** - This is a quit and abandon changes. This is the better option.
99
-
100
-
-**Option 2:** Press **`ESCAPE`**, then press and hold the **`SHIFT`** whilst typing **`Z`** twice - This is a save and quit
99
+
100
+
-**Option 2:** Press **`ESCAPE`**, then press and hold the **`SHIFT`** whilst typing **`Z`** twice - This is a save and
0 commit comments