forked from jessekathryn/git_party
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhello_world.rb
71 lines (60 loc) · 1.39 KB
/
hello_world.rb
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
# step 1
Join the meet-up event https://www.meetup.com/WomenWhoCodeNYC/events/278095956/
# step 2
Fork me!
Clone me!
CD into git_party
# step 3
Checkout a branch "my-branch"
Git Status
Git Log
# step 4
Make a Change
Git status
Git add .
Git commit -m "First Commit"
git push origin main --force
Git log
# step 5
Make a Second Change
Git status
Git add .
Git status
#step 6
Git commit -m "Squash me!"
Git status
Git log
# step 7
Git commit -m "Squash me!"
Git push origin main --force
Git log
# step 8
Rebase!
- check 'git log'
- find the commits on your branch
- exit CLI by pressing 'esc' or 'q'
- write 'git rebase -i HEAD~#of commits (2 in this case)'
# step 9
Squash your commits into one
- rebase in progress
- find commit move text input to front of line
- press 'cw' then type 'squash'
- press esc key and type ':wq!' to write your changes and quit
- next screen, move text input down to second message
- press 'dd' to delete lines of unwanted commit messages
- press esc key and type ':wq!' to write your changes and quit
# step 10
Reset --hard
- check 'git log'
- write 'git reset --hard'
- check 'git log'
# step 11
- 'git push origin --force'
- create a pr and check out your commit!
# step 12
- 'git checkout master'
- rebase with master once your branch is out of date
- 'git stash' is another helpful tool to save WIP
- 'git stash list'
- 'git stash show (name)'
- 'git stash apply' to a branch