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
@@ -9,131 +9,11 @@ description: In this tutorial, you will learn about the basic of git and 50 impo
9
9
10
10
> *This is part of GitHub/Git Tutorials and a continuation of the previous post where we discussed what is gitHub. I hope you have a basic understanding of what is Github in general. Let’s get started with Git Cheat Sheet. Git Cheat Sheet. 50 Git commands | Git Tutorials*
11
11
12
-
Git commands are handy when comes to fix any problems which you cant fix by the UI, for example consider a scenarion you need to fix the conflict in a page. Git Commands will help you to find the root cause and can explore the entire log history. At Git core it help you to keep a history of every change you made in the project files and help the user with track the changes, revert, helps to identify who made the changes.
12
+
Git commands are handy when comes to fix any problems which you cant fix by the UI, for example consider a scenario you need to fix the conflict in a page. Git Commands will help you to find the root cause and can explore the entire log history.
13
13
14
-
## Understanding Git: The Building Blocks
14
+
## Understanding Git: Adding the Files to Git
15
15
16
-
In Setting up git on Windows tutorial you learned to perform how to check the current version of the git. Now below you will see how to add some changes to the files you have created. I assume you have a small project where you created a file called filename.ipynb, now you want to add that into the git.
17
-
18
-
<Tabs>
19
-
<TabItemvalue="Git Code"label="Git Code">
20
-
21
-
```html title="Adding file to the repo"
22
-
git add filename.ipynb
23
-
```
24
-
25
-
</TabItem>
26
-
27
-
<TabItemvalue="how-git-works"label="Output on browser">
28
-

29
-
</TabItem>
30
-
</Tabs>
31
-
32
-
In this example, the `<h1>` tag creates a heading, and the `<p>` tag creates a paragraph. The browser interprets these tags and displays the content accordingly. HTML tags can be nested within each other to create more complex structures, such as lists, tables, forms, and more.
33
-
34
-
35
-
## How Web Browsers Render HTML
36
-
37
-
When a user requests a web page by entering a URL in the browser's address bar or clicking a link, the browser sends a request to the web server hosting the page. The server responds by sending the HTML content of the page back to the browser. The browser then parses the HTML code and renders the page on the user's screen.
38
-
39
-
<Tabs>
40
-
<TabItemvalue="Git Code"label="Git Code">
41
-
42
-
```html title="Commiting the changes"
43
-
git commit -m "Give some meaningfull comments"
44
-
```
45
-
46
-
</TabItem>
47
-
48
-
<TabItemvalue="how-git-works"label="Output on browser">
49
-

50
-
</TabItem>
51
-
</Tabs>
52
-
53
-
**Pushing Changes to the branch**
54
-
55
-
:::info
56
-
<Tabs>
57
-
<TabItemvalue="Git Code"label="Git Code">
58
-
59
-
```html title="Uploading file to the remote"
60
-
git push origin [name_of_your_new_branch] -> Push the branch on github :
61
-
```
62
-
63
-
</TabItem>
64
-
65
-
<TabItemvalue="how-git-works"label="Output on browser">
66
-

67
-
</TabItem>
68
-
</Tabs>
69
-
:::
70
-
71
-
3. **Git Pull**: The browser paints the pixels on the screen according to the layout determined in the rendering step. It combines the content, styles, and layout to create the final visual representation of the web page.
72
-
:::info
73
-
<Tabs>
74
-
<TabItemvalue="Git Code"label="Git Code">
75
-
76
-
```html title="Uploading file to the remote"
77
-
git push origin [name_of_your_new_branch] -> Push the branch on github :
78
-
```
79
-
80
-
</TabItem>
81
-
82
-
<TabItemvalue="how-git-works"label="Output on browser">
83
-

84
-
</TabItem>
85
-
</Tabs>
86
-
:::
87
-
4. **Reflow and Repaint**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
88
-
:::info
89
-
<Tabs>
90
-
<TabItemvalue="Git Code"label="Git Code">
91
-
92
-
```html title="Uploading file to the remote"
93
-
git push origin [name_of_your_new_branch] -> Push the branch on github :
94
-
```
95
-
96
-
</TabItem>
97
-
98
-
<TabItemvalue="how-git-works"label="Output on browser">
99
-

100
-
</TabItem>
101
-
</Tabs>
102
-
:::
103
-
By understanding how web browsers render HTML content, web developers can optimize their code and design to create fast and responsive web pages. Techniques such as minimizing the use of inline styles, reducing the number of DOM elements, and optimizing images can help improve the performance of web pages and provide a better user experience.
104
-
105
-
106
-
## Useful 50 Git Commands Cheatsheet
107
-
108
-
In addition to rendering HTML content, web browsers handle various resources associated with a web page, including:
109
-
110
-
- **CSS Stylesheets**: Browsers download and apply CSS stylesheets to control the presentation of HTML elements. Stylesheets can be linked externally using the `<link>` tag or embedded within the HTML document using the `<style>` tag.
111
-
112
-
For example, the following HTMLcode snippet links an external CSS stylesheet to the web page:
113
-
114
-
<Tabs>
115
-
<TabItem value="HTML Code" label="HTML Code">
116
-
117
-
```html title="git configuration commands"
118
-
git --version
119
-
git config _\--global #for global level config_
120
-
git config _#for project level config_
121
-
git config --global user.name <"name">
122
-
git config --global user.email <"email">
123
-
git config --global core.editor <"editor">
124
-
git config --global color.ui true
125
-
```
126
-
127
-
</TabItem>
128
-
129
-
130
-
<TabItem value="Output On Browser" label="Output On Browser">
<p style={{color: "#666"}}>This is my first web page.</p>
134
-
</BrowserWindow>
135
-
</TabItem>
136
-
</Tabs>
16
+
While Setting up git on Windows tutorial before, you learned to perform how to check the current version of the git. Now below you will see how to add some changes to the files you have created. Create a small folder in your local system, where you created a file called filename.ipynb, now you want to add that into the git.
137
17
138
18
139
19
**Git Basic Commands**
@@ -158,7 +38,7 @@ git clone _#Create a local copy of a remote repository_
158
38
</Tabs>
159
39
:::
160
40
161
-
3. **Git commits**: The browser paints the pixels on the screen according to the layout determined in the rendering step. It combines the content, styles, and layout to create the final visual representation of the web page.
41
+
1. **Git commits**: This commit provides all the staged files from your local files to move to remote repository.
162
42
:::info
163
43
<Tabs>
164
44
<TabItemvalue="Git Code"label="Git Code">
@@ -177,7 +57,8 @@ git commit --amend -m "message" #add additional info to last commit
177
57
</TabItem>
178
58
</Tabs>
179
59
:::
180
-
4. **Checking logs and views**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
60
+
4. **Checking logs and views**: Here you can see in detail about the changes and summary of the changes you made.
61
+
181
62
:::info
182
63
<Tabs>
183
64
<TabItemvalue="Git Code"label="Git Code">
@@ -198,7 +79,7 @@ git status git show
198
79
:::
199
80
200
81
201
-
4. **Git Diff**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
82
+
4. **Git Diff**: Helps you to see the change in the code as described below. Check out the output session.
202
83
:::info
203
84
<Tabs>
204
85
<TabItemvalue="Git Code"label="Git Code">
@@ -218,7 +99,7 @@ git diff -staged
218
99
:::
219
100
220
101
221
-
4. **to rename a file to directly stage**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
102
+
4. **to rename a file to directly stage**: Changing the file name is important in some case, this mv and rm git helps you to perform the same functions.
222
103
:::info
223
104
<Tabs>
224
105
<TabItemvalue="Git Code"label="Git Code">
@@ -237,7 +118,7 @@ git rm <filename>
237
118
:::
238
119
239
120
240
-
4. **Working with Git branch**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
121
+
4. **Working with Git branch**:
241
122
:::info
242
123
<Tabs>
243
124
<TabItemvalue="Git Code"label="Git branch">
@@ -260,7 +141,7 @@ git merge <source name> <Target name> #Merge a branch into a target branch
260
141
:::
261
142
262
143
263
-
4. **Undo Changes**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
4. **Adding Changes to remote**: If the user interacts with the page, such as scrolling or resizing the window, the browser may need to reflow and repaint parts of the page to reflect the changes. Reflow involves recalculating the layout of the affected elements, while repaint involves updating the affected pixels on the screen.
166
+
4. **Adding Changes to remote**:
286
167
:::info
287
168
<Tabs>
288
169
<TabItemvalue="Git Code"label="Git Code">
@@ -300,12 +181,7 @@ git push -u origin main #Push changes to remote repository and remember the bran
300
181
</TabItem>
301
182
</Tabs>
302
183
:::
303
-
By managing these resources efficiently, web developers can create engaging and interactive web pages that deliver a rich user experience. Understanding how HTML works with web browsers and how browsers render content is essential for building modern web applications that meet user expectations and performance standards.
304
-
305
-
< />
306
-
307
184
308
-
< />
309
185
<iframewidth="880"height="480"src="https://www.youtube.com/embed/jE8nqWSbUQs?list=PLrLTYhoDFx-kiuFiGQqVpYYZ56pIhUW63"title="Understanding the GitHub Flow"frameborder="0"allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share"referrerpolicy="strict-origin-when-cross-origin"allowfullscreen></iframe>
Copy file name to clipboardExpand all lines: docs/GitHub/setup-environment/setup-git-on-mac.md
+21-9Lines changed: 21 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ In the last tutorial you have learned about how to get the setup done in the win
18
18
19
19
### Step 1: Installing Git on Mac
20
20
21
+
```html title="Homebrew official website"
22
+
https://brew.sh/
23
+
```
24
+
21
25
There are four ways we can install Github on mac
22
26
23
27
#### 1. Install Via Homebrew
@@ -34,23 +38,31 @@ Here in this post, we will be using homebrew to install, Go to the homebrew webs
34
38
</BrowserWindow>
35
39
36
40
37
-
### Step 2: Select your Version you want to insatll.
41
+
### Step 2: Install Git via Homebrew
38
42
39
43
1. Once Installed use the below command to check version of the brew on terminal brew -v
40
44
41
-
Now you can install git on mac system by entering below command on terminal, In future if you want to update the version of git installed on mac or windows use the git clone https://github.com/git/git command on terminal or git bash.
45
+
Now you can install git on mac system by entering below command on terminal, In future if you want to update the version of git installed on mac use the "git clone brew upgrade" gitcommand on terminal or git bash.
42
46
43
-
44
-
```html title="create a new repository on the command line"
Copy paste the command the terminal shows, one by one on the terminal and press enter to execute it, Once all has been done, enter brew help to see if homebrew has been succesfully installed or not.
Once the setup is completed, open your visual studio code and run the command brew -v or git -v to see whethere the git has been installed or not.
53
62
63
+
```html title="To Check git on Mac System"
64
+
brew -v
65
+
```
54
66
## Conclusion
55
67
56
-
In conclusion, I hope you enjoyed reading this article on “Setting up your Git Enviornment?”. In the next post, will be discussing using Git to create a Repository and clone a project Github. Signing off Sanjay Viswanathan.
68
+
In conclusion, I hope you enjoyed reading this article on “Installing Git On Mac?”. In the next post, will be discussing using Git commands and indepth usage on Github. Signing off Sanjay Viswanathan.
0 commit comments