-
Notifications
You must be signed in to change notification settings - Fork 0
/
exercise2.txt
88 lines (60 loc) · 1.85 KB
/
exercise2.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
85
86
87
# Create a repository and push to github.
mkdir gitexercise2
cd gitexercise2
git init
git remote add origin https://github.com/himanshumishra31/gitexercise2.git
# Create two files in master branch, then create a tag 1.0.0 for first release from master
touch file1.rb
touch file2.rb
git add .
git commit -m "initialised repository with 3 files"
output
[master (root-commit) 9128ab0] initialised repository with 3 files
3 files changed, 12 insertions(+)
create mode 100644 exercise2.txt
create mode 100644 file1.rb
create mode 100644 file2.rb
git tag 1.0.0
# perform some changes in previous files and create another tag 1.0.1.
git add -u # adds all modified files to staging area
git commit -m "changes made"
output
[master 34a5c53] changes made
3 files changed, 18 insertions(+)
git tag 1.0.1
# create another file file3 and create a tag 1.1.0.
touch file3.rb
git add file3.rb
git commit -m "Added file3.rb"
output
[master 49e31f7] Added file3.rb
1 file changed, 1 insertion(+)
create mode 100644 file3.rb
git tag 1.1.0
# Now in 1.0.1 release, do some changes in existing files and create another tag 1.0.2.
git checkout -b new_branch 1.0.1
output
Switched to a new branch 'new_branch'
git add -u # changes made in file3.rb
git commit -m "changes in file3.rb"
output
[new_branch 2a6715b] changes in file3.rb
1 file changed, 1 insertion(+)
git rebase master
output
Applying: changes in file3.rb
git checkout master
git merge new_branch
output
Updating 49e31f7..09711fe
Fast-forward
file3.rb | 1 +
1 file changed, 1 insertion(+)
# Also do some changes in release 1.1.0, create a tag for next release 1.1.1
git add -u # changes made in file1.rb for new release
git commit -m "changes in file1.rb for new release"
output
[master 0d77432] changes in file1.rb for new release
1 file changed, 1 insertion(+), 1 deletion(-)
git tag 1.1.1
git push origin --all