-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathgitNotes.txt
More file actions
32 lines (17 loc) · 866 Bytes
/
Copy pathgitNotes.txt
File metadata and controls
32 lines (17 loc) · 866 Bytes
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
git branch -b branchname // makes branch
git branch -d branchname // delete branch
git checkout branchname //switches to branch
git branch // displays current branch
git diff // shows changes, trash can
git reset HEAD filename // unstage file from staging area
git checkout 'file id' // moves head to specified commit
git log -v // shows files commited
git remote -v // shows places to push to
git add // only works with new or modified files
git pull // updates repo from github
git clone 'ssh link' // makes copy of repo
git rm // remove file from repo
git checkout $hash name_of_file + git commit -m 'got from back in time' // restore an old file version
git stash // store changes so you can do other things
git reset --hard HEAD^ //go back 1 commit. forget current commit
git rebase -i HEAD^^ //rebase last 2 commits. push with -f afterwards