Skip to content

Instantly share code, notes, and snippets.

@febritecno
Last active July 28, 2023 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save febritecno/ebc3f3389e2a76620d5c5f209af00212 to your computer and use it in GitHub Desktop.
Save febritecno/ebc3f3389e2a76620d5c5f209af00212 to your computer and use it in GitHub Desktop.
Liner commit tanpa rebase by febrian dwi putra

Linier commit, tanpa capek rebase !!!

  1. create branch feature from master (important)
  2. doing…. {a lot duplicate commit}
  3. clone branch feature with name feat/{feature}-dev (tmp)
  4. git rebase -i origin/master + squash (biar satu commit)
  5. git push origin feat/{feature}-dev -f
  6. create merge request / pull request to branch development

Linier commit, with rebase

Tutorial Git sourci ( Linier history commit ) remote MR + rebase

  1. git pull development
  2. git checkout feat/32 <feat/32>
  3. git rebase development <feat/32>
  4. git rebase -i origin/development <feat/32>
  5. fixup and pick 1 (commit ter-merge) <feat/32> (biar commit jadi 1 aja)
  6. resolve conflict and change….
  7. git push origin feat/32 -f <feat/32>
  8. create mr to branch development (github)
  9. merge!
  • cara solve1 branch conflict ruwet ketika di rebase
  1. jika bisa disquash
  2. compare change dari development

*squash/menindih all commits into one

alias gisquash= 'git reset --soft HEAD~$(git rev-list --count HEAD ^master)'

*combine 2 commit to 1 commit

git reset --soft "HEAD^" git commit --amend protips :[ use rebase -i and squash selected commit in the vi editor ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment