-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommands.sh
More file actions
142 lines (84 loc) · 2.67 KB
/
commands.sh
File metadata and controls
142 lines (84 loc) · 2.67 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
git tutorial
//---------easy code to pull and push--------------//
cd <drag and drop the folder on your computer>
git init
git pull "url on the remote repository i.e on github"
git status
git add .
git commit -m "changes made..."
git status -- everything's up to date msg
git remote add origin "url on the remote repository i.e on github"
git checkout -b main -- to commit in main branch
git checkout main --alternate command
git checkout origin master -- to commit in master branch
git remote -v --displays pull and push commands in order
git push -u origin master/main
//--to work with branches
git branch -al //all branches
git branch //the name of the current branch
git add .
git commit -m "All codes saved in the current branch" //the code is lost if not committed and added to the branch
git branch NewBranch //creates the branch
git checkout NewBranch //enters the branch; make sure you have commited or else code can be lost
//when the new code is ready to be pushed to new branch
git push -u origin NewBranch
//to push everything in the current working repo to remote repo
git push --all --this command creates replicates the local repo to remote
//to delete a branch remotely
git push origin --delete branchname
//to delete a branch locally
git branch -d branchname
git push --all
git fetch --prune
//--EDUREKA commands----//
//add origin
git remote add origin ""
git pull origin
//creates local repository
cd /Users/...
git init
//linking local to master and feching to local
git remote add origin "http://"
git pull origin master
//add files initially to index to make changes in master
git status
git add nameofchangedfile.txt
git commit -m ""
git status
Git
//adding multiple files
git add -A
git commit -a -m "adding files"
git log //shows details of commits
//creating brach
git branch nameofbranch
git checkout nameofbranch //switches to nameofbranch the branch
git add -A
git commit -m ""
//merging
git merge nameofbranch //nameofbranch to be merged to master
//rebasing
git rebase master //shows whether current branch is updated to master
git checkout master
git rebase nameofbranch //works of this branch added to master
//ssh for public
ssh-keygen
//y in the queries generated
cat /../paste generated
//new ssh key via web github
//copy and paste the key
ssh-T git@github.com
//pushing to master
git checkout nameofbranch
git push origin nameofbranch
git checkout master
git push origin master
//revert
git commit -m "revert1.txt"
git commit -m "revert2.txt"
git commit -a -m "revert2.txt"
cat revert1.txt
git log
//copy first 8 digits of hexa
git checkout copiedhexa revert1.txt
cat revert1.txt //displays the rolled back version