-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGIT Reference.txt
More file actions
56 lines (27 loc) · 2.12 KB
/
GIT Reference.txt
File metadata and controls
56 lines (27 loc) · 2.12 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
GIT reference
** Shared Repository Mode_The Github Collaborative Development Model we are using**
To learn more about the Collaborative Development Model known as "Shared Repository Mode" please read within the following Web page: http://help.github.com/pull-requests/
Simple Daily Git [http://nakedstartup.com/2010/04/simple-daily-git-workflow/]
0) $ git checkout master # Make "master" the active branch
1) $ git pull -r origin master # pull all changes from the remote repository
...then we will each be creating branches by doing this:
2) $ git checkout -b mybranch # Creates a new branch called "mybranch" and makes it the active branch
Do updated work on application
... then
3) $ git add . # add any new files you have created
[Note caution to be used when adding all files (using the period (.))
A preferred method is to use $ git add -i #interactive add for multiple files or $ git add filename # for fewer files.]
4) $ git commit -m "Detailed message here" # make the commit with a nice detailed message
[Note repeat step 4) often. step 3) is only necessary if a new file has been created. Use $ git status to inspect untracked files]
[Note $ git commit -am "Detailed message here" # does both steps 3) and 4) in one command]
... pushing changes
5) $ git checkout master # switch back to the master branch when the feature is done. Makes "master" the active branch
6) $ git pull -r origin master # See step 1) for details
[Note Once youre finished working on your branch and are ready to combine it back into the master branch, use merge.]
7) $ git merge mybranch # Merges the commits from "mybranch" into "master"
8) $ git push # sends your changes up to the remote repository
9) $ git branch -d mybranch # deletes the mybranch branch
To Undo in Git http://book.git-scm.com/4_undoing_in_git_-_reset,_checkout_and_revert.html
1) $ git revert mybranch # Revert commit "mybranch"
2) $ git commit -a --amend # To use after you have fixed the broken files.
Reference: http://ktown.kde.org/~zrusin/git/git-cheat-sheet-medium.png http://cheat.errtheblog.com/s/git/ (look at the bottom of this URL for clean descriptions of common tasks)