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](./Index.md/#branch) is a seperate version of the main repository.<br/>
9
+
A [branch](/docs/tutorials/Git%20Version%20Control/Basics/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](./Index.md/#merge) back into the main branch/project.<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/>
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](./Index.md/#branch) to work on a feature without modifying the main project's working code:
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:
The command `git branch hello-world-pictures` will create a new [branch](./Index.md/#branch) called "hello-world-pictures".<br />
23
+
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 />
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](./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](/docs/tutorials/Git%20Version%20Control/Basics/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](./Index.md/#branch) and change to the "hello-world-pictures" [branch](./Index.md/#branch) we have to use the [`checkout`](./Index.md/#checkout) command.
37
+
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.
@@ -77,7 +77,7 @@ Then let's update our html code:
77
77
</html>
78
78
```
79
79
80
-
Let's [save and exit](./New%20Files.md/#basic-editing-on-vim) and check the status of the current [branch](./Index.md/#branch)
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)
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](./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](/docs/tutorials/Git%20Version%20Control/Basics/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](./Index.md/#staging-area):
99
+
So let's add all the changes to the [staging area](/docs/tutorials/Git%20Version%20Control/Basics/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](./Index.md/#branch):
104
+
Now let's check the status of the [branch](/docs/tutorials/Git%20Version%20Control/Basics/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](./Index.md/#commit) them to our [branch](./Index.md/#branch):
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):
[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](./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](/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.
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](./Index.md/#branch):
141
+
Finally let's check the content of this [branch](/docs/tutorials/Git%20Version%20Control/Basics/Index.md/#branch):
Copy file name to clipboardExpand all lines: docs/tutorials/Git Version Control/Basics/Index.md
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -40,7 +40,7 @@ Index of terminology within this tutorial
40
40
>*Text Editor* <br /> A free and open-source, screen-based text editor. It is an improved version of the **vi** editor. It's primary interface is in text user interface with commands rather than menus or icons.
41
41
42
42
### Stage
43
-
>*verb*: To prepare a file for a [commit](#commit). `git stage`
43
+
>*verb*: To prepare a file for a [commit](#commit) by placing it into the [staging area](#staging-area). `git stage`
44
44
45
45
### Staging area
46
46
>*noun*: The *conceptual* area between your working directory and your repostory that maintains all of your [staged](#stage) changes. A useful [diagram](../../../../static/img/git-tutorial/staging-area.png).
0 commit comments