-
Notifications
You must be signed in to change notification settings - Fork 25
/
git_notes.txt
84 lines (59 loc) · 1.49 KB
/
git_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
73
74
75
76
77
78
79
80
81
82
83
84
#############
# git notes #
#############
# create empty repository
git init
# add to reposiotry
git add <file>
# status of repo
git status
# commit
git commit -a -m 'comit comment'
# revert back to previous commit of a file
git reset HEAD <somefile.txt>
# revert back the whole index
git reset HEAD
# new branch
## master by default
git checkout -b new_branch
# swich back to master branch
git checkout master
# look at current branches
# the branch you are using will be green and have a * by it
git branch -v
# switch back to new branch
git checkout new_branch
# modify and commit within new_branch
vi <file> / save
git add <file>
git commit -a -m <file>
# switch back to master
git checkout master
*** Look at file you edited, changes commited to new_branch should be gone
# merge changes into master
git merge new_branch
*** Look at file you edited, changes commited to new_branch should be visible
# create remote git bare reposity
# on lazlo id
cd /Volumes/iES2/git
git init bare
# add origin to client git repo
cd python
git add origin dlb@lazlo:/Volumes/iES2/git/python.git
cd ruby
git add origin dlb@lazlo:/Volumes/iES2/git/ruby.git
# view origin
git remote -v
# push changes
git push
# pull changes
git pull
# git server
nohup git daemon --reuseaddr --base-path=/Volumes/iES2/git/ --export-all --verbose --enable=receive-pack &
# git bare repo now looks like this
origin git://lazlo/python.git
origin git://lazlo/ruby.git
# remove a branch
git branch -d new_release
# gui git client
gitk