-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDay11.txt
More file actions
115 lines (77 loc) · 2.47 KB
/
Day11.txt
File metadata and controls
115 lines (77 loc) · 2.47 KB
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
git init == To initialize a local repo
-- ls -a
Tracking logging -- .git is used
.git/hooks/pre-commit == to know
ls -lrta
rm -r git-devops-demo/
=====================
To delete dir
To check changes use git diff
================================
ubuntu@ip-172-31-93-78:~/gitdemo$ git diff
diff --git a/cal.sh b/cal.sh
index eb48a9e..191070f 100644
--- a/cal.sh
+++ b/cal.sh
@@ -1,3 +1,4 @@
#!/bin/bash
# Addition function
+x=1+2
ubuntu@ip-172-31-93-78:~/gitdemo$
If you agree with changes then use git add cal or git add . ( Here if we use . then all files will be added )
or
if we don't want changes then use
git checkout cal
===========================
-- git init
-- git add . or git add cal
-- git commit -m "lsldf"
===============================
git add
git commit -m ""
git push
==================================
git remote -v
== to check remote push or fetch is there or not
-- We can clone the repo by 2 ways 1 is using https and other is using ssh
1 way
=====
git clone ....
it will ask for password in some cases
2 nd way
=========
git clone ....
it will ask for public key to generate public key use this
ssh-keygen -t rsa
--- id_rsa.pub file
-- open the public key and copy in github
-- settings -- ssh keys -- new ssh key
-- title key and add
=================================
Difference b/w clone and fork
-----------------------------------
-- We go to any repo and we clone that pulic repo to local and do development of that ( Clone )
-- Fork -- Multiple copies of repo and create replicas
Create a copy of repo
============================
git merge
git rebase
git cherry-pick -- picking the commits
To merge the code from other branchs to main or master branch
git log dev-1.0.1 ( branch name)
git checkout dev-1.0.1 && git log
Above 2 commands are same
-- If we want to get changes from one branch to another branch -- then i easy way is to use cherry pick
-- If cherry pick is easy if there is one or 2 commits
but if we have more commits then use git merge or git
rebase
differnce b/w git merge and git rebase
----------------------------------------------
-- Git rebase
-- Git merge
git log --oneline == To get the logs in one line
NOTE: If you are in git log with long commit and then to exit use q
press q
-- If we got any merge conflict then fix the conflict and again use
git rebase --continue
================================================