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: docs/tutorials/Git Version Control/Basics/Branch.md
+13-13Lines changed: 13 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -6,21 +6,21 @@ sidebar_position: 6
6
6
7
7
### Using Git branches
8
8
9
-
A [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) is a seperate version of the main repository.<br/>
9
+
A [branch](./Index.md#branch) is a seperate version of the main repository.<br/>
10
10
Branches are particuarly useful when a developer wants to update parts of a large project.
11
11
12
12
Git branches allow development on a new features and designs independent from other work on the main branch.<br/>
13
-
When the work is complete on a branch, it can be [merged](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#merge) back into the main branch/project.<br/>
13
+
When the work is complete on a branch, it can be [merged](./Index.md#merge) back into the main branch/project.<br/>
14
14
With branches, it's also possible to work on different parts of a project simultaneously without any part impacting another.
15
15
16
16
### Creating a new Branch
17
17
18
-
Let's create a new [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) to work on a feature without modifying the main project's working code:
18
+
Let's create a new [branch](./Index.md#branch) to work on a feature without modifying the main project's working code:
The command `git branch hello-world-pictures` will create a new [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) called "hello-world-pictures".<br />
23
+
The command `git branch hello-world-pictures` will create a new [branch](./Index.md#branch) called "hello-world-pictures".<br />
24
24
Let's confirm that the branch was created:
25
25
```bash
26
26
[user@localhost] $ git branch
@@ -29,12 +29,12 @@ hello-world-pictures
29
29
```
30
30
> Important: Whenever creating new branches, the branch from which the *new* branch is sourced from is the branch which was mounted when the git branch command was called. In scenario above, the command was called from within the `master` branch. Hence, all the initial files and changes are sourced from the `master` branch for the `hello-world-pictures` branch.
31
31
32
-
A new branch called "hello-world-pictures" has been created, however the `*` symbol indicates that we are currently still on the `master`[branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch).
32
+
A new branch called "hello-world-pictures" has been created, however the `*` symbol indicates that we are currently still on the `master`[branch](./Index.md#branch).
33
33
> When viewing the output of `git branch`, the `*` symbol indicates the current branch.
In order to leave the `master`[branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) and change to the "hello-world-pictures" [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) we have to use the [`checkout`](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#checkout) command.
37
+
In order to leave the `master`[branch](./Index.md) and change to the "hello-world-pictures" [branch](./Index.md) we have to use the [`checkout`](./Index.md#checkout) command.
@@ -77,7 +77,7 @@ Then let's update our html code:
77
77
</html>
78
78
```
79
79
80
-
Let's [save and exit](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#basic-editing-on-vim) and check the status of the current [branch](./Index.md/#branch)
80
+
Let's [save and exit](./New%20Files.md/#basic-editing-on-vim) and check the status of the current [branch](./Index.md#branch)
81
81
82
82
```bash
83
83
[user@localhost] $ git status
@@ -94,14 +94,14 @@ Untracked files:
94
94
no changes added to commit (use "git add" and/or "git commit -a")
95
95
```
96
96
97
-
The output indicates that there are tracked changes to `index.html`, however the file is not [staged](./Index.md/#stage) for a [commit](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#commit). Moreover, there is also the image `git.png` that is currently untracked.
97
+
The output indicates that there are tracked changes to `index.html`, however the file is not [staged](./Index.md#stage) for a [commit](./Index.md#commit). Moreover, there is also the image `git.png` that is currently untracked.
98
98
99
-
So let's add all the changes to the [staging area](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#staging-area):
99
+
So let's add all the changes to the [staging area](./Index.md#staging-area):
100
100
```bash
101
101
[user@localhost] $ git add --all
102
102
```
103
103
104
-
Now let's check the status of the [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch):
104
+
Now let's check the status of the [branch](./Index.md#branch):
105
105
```bash
106
106
[user@localhost] $ git status
107
107
On branch hello-world-pictures
@@ -113,7 +113,7 @@ Changes to be committed:
113
113
114
114
Now all the changes are staged and can be committed.
115
115
116
-
Since we're satifisied with our changes, let's [commit](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#commit) them to our [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch):
116
+
Since we're satifisied with our changes, let's [commit](./Index.md#commit) them to our [branch](./Index.md#branch):
[hello-world-pictures 83d7fb0] feat: Added image to hello world
@@ -130,15 +130,15 @@ Let's check content within our branch:
130
130
[user@localhost] $ ls
131
131
git.png index.html README.md styles.css
132
132
```
133
-
Notice how the `hello-world-pictures`[branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch) has the image `git.png`. As per the edits we've made, `index.html` should also have modified code to include the image.
133
+
Notice how the `hello-world-pictures`[branch](./Index.md#branch) has the image `git.png`. As per the edits we've made, `index.html` should also have modified code to include the image.
134
134
135
135
Now's let's change to the `master` branch using the `checkout` command:
136
136
```bash
137
137
[user@localhost] $ git checkout master
138
138
Switched to branch 'master'
139
139
```
140
140
141
-
Finally let's check the content of this [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch):
141
+
Finally let's check the content of this [branch](./Index.md#branch):
Commits keep track of progress and changes as we work. Git treats each [`commit`](./Index.md/#commit) as a "save point". It's a point in the project which can be reverted to if a bug is found, or you want to make a change.
9
+
Commits keep track of progress and changes as we work. Git treats each [`commit`](./Index.md#commit) as a "save point". It's a point in the project which can be reverted to if a bug is found, or you want to make a change.
10
10
11
-
Whenever performing a [`commit`](./Index.md/#commit), **always** include a commit **message**.
11
+
Whenever performing a [`commit`](./Index.md#commit), **always** include a commit **message**.
12
12
It's always best practice to do so and improves understanding of your code for others and subsequently maintainability of your project.
13
13
14
14
```bash
@@ -46,16 +46,16 @@ To show this let's update `index.html` slightly:
46
46
</body>
47
47
</html>
48
48
```
49
-
>Recall, to open a file to edit in your working directory with [Vim](./Index.md/#vim), enter the command `vim `*`filename`* and enter insert mode (`I` key on the keyboard). To save and exit enter normal mode (`esc` key) and enter the command `:wq` (write and quit).
49
+
>Recall, to open a file to edit in your working directory with [Vim](./Index.md#vim), enter the command `vim `*`filename`* and enter insert mode (`I` key on the keyboard). To save and exit enter normal mode (`esc` key) and enter the command `:wq` (write and quit).
50
50
51
-
Now let's check the status of our [repo](./Index.md/#repository-repo), however with the `--short` option to get a more compact response:
51
+
Now let's check the status of our [repo](./Index.md#repository-repo), however with the `--short` option to get a more compact response:
52
52
```bash
53
53
[user@localhost] $ git status --short
54
54
M index.html
55
55
```
56
56
> Note: The `--short` option on `git status` is also synonymous with `-s`. Hence, either `git status -s` or `git status --short` can be used to perform the same action.
57
57
58
-
Here's some valuable [information](./Index.md/#git-status-short) about short git status flags.
58
+
Here's some valuable [information](./Index.md#git-status-short) about short git status flags.
Copy file name to clipboardExpand all lines: docs/tutorials/Git Version Control/Basics/Index.md
+4-1Lines changed: 4 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,10 @@ sidebar_position: 10
7
7
Index of terminology within this tutorial
8
8
9
9
### Push
10
-
>*noun*: To publish your changes to a repository: `git push`
10
+
>*noun, verb*: To publish your changes to a repository: `git push`
11
+
12
+
### Pull
13
+
>*noun, verb*: To fetch and integrate changes in a remote [repository](#repository-repo) with the changes in a local [repository](#repository-repo). `git pull`*` remote-name branch-name`*
11
14
12
15
### Repository (*repo*)
13
16
>*noun*: A type of centrally located storage where you can keep all your project's files and resources.
Copy file name to clipboardExpand all lines: docs/tutorials/Git Version Control/Basics/Merging.md
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -6,7 +6,7 @@ sidebar_position: 7
6
6
7
7
## Merging Branches
8
8
9
-
Branch [merging](./Index.md/#merge) allows the changes from one branch to be added to another, essentially combining the changes. Merging typically goes hand in hand with branches since the changes specific to a branch are often combined back to the main project code. A common scenario in industry is to use [branches](./Index.md/#branch) to work of specific issues, features, or perform code maintainence. Once the edits are complete, the [branch's](./Index.md/#branch) edits are [merged](./Index.md/#merge) back into a `master` or main branch which contains the code used in production.
9
+
Branch [merging](./Index.md#merge) allows the changes from one branch to be added to another, essentially combining the changes. Merging typically goes hand in hand with branches since the changes specific to a branch are often combined back to the main project code. A common scenario in industry is to use [branches](./Index.md#branch) to work of specific issues, features, or perform code maintainence. Once the edits are complete, the [branch's](./Index.md#branch) edits are [merged](./Index.md#merge) back into a `master` or main branch which contains the code used in production.
10
10
11
11
Let's demonstrate how to merge branches alongside a bit of review!
12
12
@@ -58,8 +58,8 @@ Great! Now since our modifications are unstaged, let's go ahead and stage them a
58
58
```
59
59
> Note: The command above used the `-a` option to stage and commit all changes in one-step.
60
60
61
-
Finally, now let's [merge](./Index.md/#merge) our changes back into the `master` branch! <br/>
62
-
First we need to [`checkout`](./Index.md/#checkout) to to the `master` branch.
61
+
Finally, now let's [merge](./Index.md#merge) our changes back into the `master` branch! <br/>
62
+
First we need to [`checkout`](./Index.md#checkout) to to the `master` branch.
63
63
```bash
64
64
[user@localhost] $ git checkout master
65
65
Switched to branch 'master'
@@ -80,4 +80,4 @@ Since we're done working on the `copyright-fix` branch and it's no longer needed
80
80
Deleted branch copyright-fix (was 5be7c4a).
81
81
```
82
82
83
-
Amazing! We successfully managed to add a new piece to our project using [branches](./Index.md/#branch) and sucessfully [merged](./Index.md/#merge) the changes back to the `master`[branch](./Index.md/#branch).
83
+
Amazing! We successfully managed to add a new piece to our project using [branches](./Index.md#branch) and sucessfully [merged](./Index.md#merge) the changes back to the `master`[branch](./Index.md#branch).
Copy file name to clipboardExpand all lines: docs/tutorials/Git Version Control/Basics/New Files.md
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -6,9 +6,9 @@ sidebar_position: 3
6
6
7
7
### Adding new Files
8
8
9
-
Let's find out how to add new files to a git [repository](./Index.md/#repository-repo)! <br />
10
-
Within this tutorial, we'll be using the [Vim](./Index.md/#vim) CLI text-edtior to create a edit files. <br /> This can just as easily be done with your prefered text-editor. <br />
11
-
IE with `code .` to open the current working directory within [Visual Studio Code](./Index.md/#visual-studio-code).
9
+
Let's find out how to add new files to a git [repository](./Index.md#repository-repo)! <br />
10
+
Within this tutorial, we'll be using the [Vim](./Index.md#vim) CLI text-edtior to create a edit files. <br /> This can just as easily be done with your prefered text-editor. <br />
11
+
IE with `code .` to open the current working directory within [Visual Studio Code](./Index.md#visual-studio-code).
12
12
13
13
```shell
14
14
[user@localhost] $ vim index.html
@@ -46,16 +46,16 @@ Let's put some code within `index.html`:
46
46
</html>
47
47
```
48
48
#### Basic Editing on Vim
49
-
>In order to enter content into `index.html` using [Vim](./Index.md/#vim), enter insert mode by pressing the "I" key on your keyboard. Then either type or paste the code into the editor. <br />
50
-
To save and exit out of [Vim](./Index.md/#vim) simply press the escape key and then type and enter `:wq` (write and quit).
49
+
>In order to enter content into `index.html` using [Vim](./Index.md#vim), enter insert mode by pressing the "I" key on your keyboard. Then either type or paste the code into the editor. <br />
50
+
To save and exit out of [Vim](./Index.md#vim) simply press the escape key and then type and enter `:wq` (write and quit).
51
51
52
-
Now let's check the contant of our directory using [`ls`](./Index.md/#ls):
52
+
Now let's check the contant of our directory using [`ls`](./Index.md#ls):
53
53
```shell
54
54
[user@localhost] $ ls
55
55
index.html
56
56
```
57
57
58
-
Since the file is within our directory now, let's check if it's part of our [repo](./Index.md/#repository-repo) using `git status`:
58
+
Since the file is within our directory now, let's check if it's part of our [repo](./Index.md#repository-repo) using `git status`:
59
59
```shell
60
60
[user@localhost] $ git status
61
61
On branch master
@@ -75,4 +75,4 @@ There are two potentional states for files in a repository folder:
75
75
* Tracked: git knows about these and they are in your repository
76
76
* Untracked: files that are in your working directory, however not added to your repository.
77
77
78
-
Adding the first files to an empty repository are all untracked. In order for them to be tracked, they must be [staged](./Index.md/#stage) or must add them to a [staging area](./Index.md/#staging-area)
78
+
Adding the first files to an empty repository are all untracked. In order for them to be tracked, they must be [staged](./Index.md#stage) or must add them to a [staging area](./Index.md#staging-area)
Copy file name to clipboardExpand all lines: docs/tutorials/Git Version Control/Basics/Staging Area.md
+6-6Lines changed: 6 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -8,14 +8,14 @@ sidebar_position: 4
8
8
9
9
As you are working on a project, you add, edit, and remove files. When you reach a satisfactory point, you should add the files to a staging area.
10
10
11
-
[Staged](Index.md/#stage) files are ready to be [committed](./Index.md/#commit) to your working repository.
11
+
[Staged](Index.md#stage) files are ready to be [committed](./Index.md#commit) to your working repository.
12
12
13
13
Back to our `newProject`, we can now make `index.html` as a tracked file by simple adding it to the staging area using `git add`:
14
14
```shell
15
15
[user@localhost] $ git add index.html
16
16
```
17
17
18
-
Now `index.html` should be [staged](./Index.md/#stage):
18
+
Now `index.html` should be [staged](./Index.md#stage):
19
19
```shell
20
20
[user@localhost] $ git status
21
21
On branch master
@@ -31,7 +31,7 @@ In other words, the file is now added to the staging area!
31
31
32
32
### Staging more than one file
33
33
34
-
It's often that we end up modifying more than one file within a project before we decide to [stage](./Index.md/#stage) them. Let's see how to [stage](./Index.md/#stage) them all at once:
34
+
It's often that we end up modifying more than one file within a project before we decide to [stage](./Index.md#stage) them. Let's see how to [stage](./Index.md#stage) them all at once:
35
35
36
36
Let's start by adding a `README.md` file to our repository to describe it:
37
37
```shell
@@ -42,7 +42,7 @@ and add the following content:
42
42
# Hello world
43
43
This repository exists as part of a git tutorial!
44
44
```
45
-
>Recall to use the `:wq` command in [Vim](./Index.md/#vim) to write and quit.
45
+
>Recall to use the `:wq` command in [Vim](./Index.md#vim) to write and quit.
46
46
47
47
Let's also add a CSS file called `styles.css`:
48
48
```shell
@@ -60,7 +60,7 @@ body {
60
60
animation-duration: 4s;
61
61
}
62
62
```
63
-
>Again, recall to use the `:wq` command in [Vim](./Index.md/#vim) to write and quit.
63
+
>Again, recall to use the `:wq` command in [Vim](./Index.md#vim) to write and quit.
64
64
65
65
Finally let's update `index.html` to include our new stylesheet (`styles.css`):
66
66
```shell
@@ -80,7 +80,7 @@ Finally let's update `index.html` to include our new stylesheet (`styles.css`):
80
80
</body>
81
81
</html>
82
82
```
83
-
> Once again, recall to use the `:wq` command in [Vim](./Index.md/#vim) to write and quit.
83
+
> Once again, recall to use the `:wq` command in [Vim](./Index.md#vim) to write and quit.
84
84
85
85
Now let's add all these new files and changes to our staging area using the following command:
0 commit comments