-
Notifications
You must be signed in to change notification settings - Fork 11
/
usefulgit.txt
52 lines (38 loc) · 1.42 KB
/
usefulgit.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
# change your current branch using
git checkout master
git checkout chris-work
git checkout alex-work
# check which branch you're in, and other information
git status
# typical commands to upload to github, once your editing is done
git add .
git commit -m "some description goes here"
git push
# don't forget to perform a pull-request; not sure how to do this
# on the command line (might be possible)
# once your branch has been merged into the master, you can re-sync your branch
# using the following- note that you need to pull the updated master first
git checkout master
git pull
git checkout whichever-branch-you-want
git rebase master
# undo all UNcommitted changes see http://stackoverflow.com/questions/14075581/git-undo-all-uncommited-changes
git reset
git checkout .
git clean -fdx
# http://stackoverflow.com/questions/6897600/git-push-failed-non-fast-forward-updates-were-rejected
git pull origin chris-work
# access a single file from a different branch with out checking out the whole branch
# http://stackoverflow.com/questions/7856416/view-a-file-in-a-different-git-branch-without-changing-branches
git show branch:file
# pulling a remote branch (useful when re-cloning)
http://stackoverflow.com/questions/9537392/git-fetch-remote-branch
# writing this from windows machine
# from challenge aneka
# your edits here
# Ann's name goes here?
# Following Ann's lead
Carly Vollet
Heiko Spoddeck
Virginia Somes
Michele Marden