-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitCommand.txt
More file actions
72 lines (46 loc) · 1.45 KB
/
gitCommand.txt
File metadata and controls
72 lines (46 loc) · 1.45 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
//configure git account
git config --global user.name "BadPistol97"
git config --global user.email 1151104900@student.mmu.edu.my
//clone repository from webpage
git clone <url path>
//add file to git
git add <filename>
//check git status
git status
//commit file
git commit -m "commited message" <filename>
//upload file
git push -u origin master
//go to other branch
git checkout <branch>
//gets you up to date with origin ; "gimme everything you have that I
don't"
git fetch origin
//pull from github
git merge origin/master
//to see what they have that I don't
git log origin
//to create a new repository on the command line
git init
git add webScraping.py
git commit -m "first commit"
git remote add origin https://github.com/BadPistol97/webScraping.git
git push -u origin master
//to push a new local branch to a remote Git repository and track it too
git checkout -b <branch_name>
git push -u origin <branch_name>
//to make change to file from remote
git add <filename>
git commit
git push
// Branching
- git branch <newBranch>
- git checkout <newBranch>
- git add <newItem>
- git commit -m "commit"
- git push --set-upstream origin <newBranch>
- git merge --no-ff <newBranch> # merge in master branch
- git merge origin master # merge in new branch but only existing files
- git push origin master # update the merge to the hub
- git push --delete origin newVersion # update deleted branch to hub
- git branch -d <newBranch> # delete local branch