-
Notifications
You must be signed in to change notification settings - Fork 0
/
gitcommands.txt
117 lines (72 loc) · 2.6 KB
/
gitcommands.txt
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
git config --global user.name"Sinai"
git config --global user.email"sinai4l@gmail.com"
/* Beginnen with git */
git init
/* Check for configuration file, Repository/Origin adrees, UsrName and Email */
git config --list
/updating computer map with reposetery/
git pull origin <branchname>/ waarbij branchname kan zijn master/ of wat for branch dan ook!
++++
/set a upstream/
git branch --set-upstream-to=origin/master master
git branch --set-upstream-to=origin/<branch> <branch> is the branch name
++++
/create file/
touch README
/modify file and save/
/ADD NEW FILES AND COMMIT/
git add .
/commit/
git commit -m 'the comments'
/to see all the commits from everybody/
git log
IF YOU ARE WORKING ON NEW/EXISTING BRANCH
/how to add branch on computer disk/
git branch BranchName
/switch to branch/
git checkout 'BranchName'
HOW TO ADD MODIFICATIONS/NEW FILES IN THE BRANCH
/create file/
touch README
/modify file and save/
/ADD NEW FILES AND COMMIT/
git add .
/commit/
git commit -m 'the comments'
/How to merge the branch back to master/
git checkout master
git merge BranchName
/ to update the online repositery /
git push origin <branchname>, <branchname> could be any branch or master
/to remove the comment/
git reset --soft Head^
/to remove th comments and undo changes/
git reset --hard HEAD^
/add a reposetery to map/
git remote add origin https://githube/Sinai/reposeteri.git
/adding to repostery/-updating - you create a branch with comment and the file added/updated/
git push origin master
/check in which branch your are working/
git branch
If you want to update your owbn reposetery
1) go to the location home/team-wordpress android/ with cmd
2) check in which branch you are!
3) git branch --set-upstream-to=origin/<branch> <branch> is the branch name
4) git pull origin <branch>, <branch> is the branch name!
If you want to update a existing branch
go local (on computer) to the branch
add the files to the map home/team-wordpress android/
do a add .
do a git commit -m 'the comments'
do a git push origin <branch> ,,, <branch> is the branch that you want to update
/* HOW TO SET UP THE .netrc FILE FOR LINUX */
/*This file will contain the server/username/password */
1) Create a file (.netrc) in your Home directory
2) Add following to the file;
machine <hostname1> replacing <hostname> with the server's hostname
login <login1> replacing <login1> with your idd
password <password1> replacing <password1> with your password
machine <hostname2> You can add additional users
login <login2>
password <password2>
3) Save the file and git will use it automaticlly