Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit d55a0e4

Browse files
new script added for understanding git rebase
1 parent 390f2d8 commit d55a0e4

File tree

1 file changed

+27
-0
lines changed
  • c3_introduction_git_github/m3_working_with_remotes/src

1 file changed

+27
-0
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Video: Rebasing your changes
2+
git checkout master # switch to master branch
3+
git pull # get the latest changes from the remote repository
4+
git log --graph --oneline --all # view the commits in log which we want to rebase
5+
git checkout refactor # switch to the branch we want to rebase
6+
git rebase master # rebase the branch on top of master
7+
git log --graph --oneline --all # view the commits in log after rebasing
8+
git checkout master # switch to master branch
9+
git merge refactor # merge the branch into master
10+
git push --delete origin refactor # delete the remote branch
11+
git branch -d refactor # delete the local branch
12+
git push # push the changes to the remote repository
13+
14+
# Video: Another Rebasing example
15+
# NOTE: working on small changes, hence no need to create a new branch
16+
code all_checks.py # modify file
17+
git commit -a -m 'Add a simple network connectivity check'
18+
git fetch # fetch the changes from the remote repository (to see if our colleagues have made any changes, but doesn't merge them)
19+
git rebase origin/master # rebase the local changes on top of the remote changes (NOTE: creates conflict here)
20+
code health_checks.py # fix the conflict
21+
./health_checks.py # test the code (NOTE:gives error here)
22+
code health_checks.py # fix the error
23+
./health_checks.py # test the code
24+
git add health_checks.py
25+
git rebase --continue # continue the rebase process
26+
git log --graph --oneline # view the commits in log after rebasing completely
27+
git push

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /