- 👋 Hi, I’m
dch nguyen
- 👀 I’m interested in OLAP, Scala, Python
- 🌱 I’m currently learning Scala, Python
You will not want to use it!
$ git fetch origin/master
$ git merge origin/master
# Resolve conflict and create merge commit
$ git add path/to/files
$ git commit -m "blah blah"
$ git fetch origin/master
$ git rebase origin/master
# after resolve conflict
$ git add path/to/files
$ git rebase --continue
# if you want abort rebase process
$ git rebase --abort
# Push
$ git push -f
# Create new branch from
$ git checkout -b origin/SPARK-xxx
# Push to remote
$ git push remote_name SPARK-xxx:SPARK-xxx
# Merge all change as single commit when you want create new branch
$ git checkout -b merge_branch master
$ git merge --squash feature_1_branch
# rebase multiple commits to single commit
$ git rebase -i HEAD~N # N is number of commit
# change 'pick' key word to 'squash'
# modify comment
$ git commit --amend
# modify author
$ git commit --amend --author="Author Name <email@address.com>" --no-edit
# Show all current remote
$ git remote -v
# Add new remote
$ git remote add remote_name https://blahblah.git
# Delete a remote
$ git remote rm remote_name
Get commit from a branch Git cherry-pick is useful tool but not a best practice(cause duplicate commits)
# Find hash_commit in git log, and then pick that commit to current branch for applying
$ git cherry-pick <hash_commit>
$ git cherry-pick <hash_commit1> <hash_commit2> ...
# Pick the latest commit from branch 'AAA'
$ git cherry-pick <AAA~1>