-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
119 lines (74 loc) · 3.23 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<h1>This is Git tutorial</h1>
*************** ****************** ******************** *****************
Description -
GIT -
Version Control system is a tools that helps to track changes in code.
Git is version control System it is:
- Popular
- Free and open source
- Fast and scalable
Uses -
1. To track the History
2. Collaborate
*************** ****************** ******************** *****************
GIt Hub
Website that allows developers to store and menage their code using Git.
*************** ****************** ******************** *****************
Configuring Git
git config --global user.name "My name(github acc name)"
git config --global user.email "email edd."
git config --list (to varify what detail we added)
*************** ****************** ******************** *****************
Clone and Status
Clone - Cloning a respository on our local machine (go to repository and click code, then copy https link and paste here)
git clone --some link--
Status - Display the status of code -> git status
*************** ****************** ******************** *****************
M -- that is mean is Modified file, or some chnages in this file
U -- Untrack file, that mean Git is not tracking this file, this is new file
Stage - file is ready to be commit
unmodified - unchanged
ls -h -- mean show list of hidden file
*************** ****************** ******************** *****************
For upload the code on GitHub ( Add and Commit )
Add -
adds new or changes file in your working directory to the Git staging area
git add --file name-- /or git add . (for combine all files)
Commit -
it is the record of changes
git commit -m "some message what you change"
*************** ****************** ******************** *****************
git push origin main -- for push file to GitHub
> git psuh -- mean push file to git repo
> origin -- mean origin repo from all repo where we done clone , this is called origin
> main -- branch
*************** ****************** ******************** *****************
init command -
init - used to create a new git repo
git init
git remove add origin --link here--
git remove -v (to varify remote)
git branch (to check branch)
git branch -M main (to remove branch)
git push origin main -- when we push few file
git push -u -- when you want to push more file in same Repository then use it
*************** ****************** ******************** *****************
back to previous Folder -- cd ..
make new folder - mkdir --foldername--
Enter in new folder - cd --foldername--
*************** ****************** ******************** *****************
Branch Commmands
- git branch - (to check branch)
- git branch -M main ( to rename branch)
- git checkout --branch name-- (to nevigate)
- git checkout -b --new branch name-- ( to create new branch)
- git branch -d --branch name-- (to delete branch)
*************** ****************** ******************** *****************
Merging Code
way 1 -
- git diff --branch name-- (to compare commit , branches , file and more)
- git merge --branch name-- (to merge 2 branches)
way 2
- Craete a PR (Pull Request)
Merge conflicts
An event that takes place when Git is unable to automatically resolve differences in code between two commits.