-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnotes.txt
72 lines (47 loc) · 2.38 KB
/
notes.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
git init - create an empty git repostitory or reinitialize an existing one
git status
git status
git add octocat.txt (staging area)
git status
git commit -m "Add cute octocat story"
git add '*.txt'
git log (list history of commits)
git remote add origin git@github.com:thraddash/try_git.git (push local to github server)
git push -u origin master (name of our remote is origin, default local branch is master, -u tells Git to remember the parameter so you can run git push)
git pull orgin master ( to check for changes in github repo)
git diff Head (use Head to diff most recent commit)
git add octofamily/octodog.txt
git diff --staged ( see changes you just staged)
git reset octofamily/octodog.txt (unstage files)
git checkout -- octocat.txt (return to the last commit)
--------------------------------
branching out (wehen developer work on feature/bug create a copy aka (branch) then merge them back to main master branch
git branch clean_up (should see 2 local branch: a main branch master, new branch clean_up)
git checkout clean_up
git rm '*.txt' (remove all octocat)
git status
git commit -m "Remove all the cats"
git checkout master (go back to master branch)
===>> merge clean_up into master branch
git merge clean_up
===>> since you are done with clean_up branch you can delete the branch
git branch -d clean_up
==> push everything that yoube been working on back to your remote repo
###
git log
git checkout -- . #### unstage all files
git reset SHA checksum
head | index | working directory
git commit | git add | vi file
#### pull files from remote repo #####
git config -l (check git config setting, to see if remote repo has been added)
git branch (check which branch you are currently on)
git checkout "name of the branch" (switch your branch)
git diff orgin/mysql (compare the changes remote repository with current repository)
git fetch (will download all recent changes, but will not put it with current checkout codes)
git checkout orgin/mysql --path/to/filename (will checkout the particular file from the the downloaded changes (origin/mysql)
git commit path/to/filename -m (enter a message of for the changes)
git log (list the history of commit changes)
git push origin/mysql (push changes back to a remote repo/ targeting branch mysql)
######
git archive master |tar -x C --path/repostiory (remove git revision history, tar file, untar file to directory path)