git rebase - RedHatInsights/red-hat-ansible-automation-platform-documentation GitHub Wiki

git rebase example

The following code displays the output for a successful sync. The git log commands show the commits in the local branch before and after you incorporate the new upstream commits.

$ git checkout main
Switched to branch 'main'

$ git log --oneline -n 3
58ac8c9 (HEAD -> main, origin/main, origin/HEAD) Merge pull request #102 from cbudz/main
07bf6d6 fix hub doc
f2b145b README: Link to mod-docs guide build

$ git fetch upstream
remote: Enumerating objects: 21, done.
remote: Counting objects: 100% (21/21), done.
remote: Compressing objects: 100% (13/13), done.
remote: Total 21 (delta 10), reused 15 (delta 8), pack-reused 0
Unpacking objects: 100% (21/21), done.
From github.com:RedHatInsights/red-hat-ansible-automation-platform-documentation
   dc1ec45..1de4d04  1.2        -> upstream/1.2

$ git rebase upstream/main
First, rewinding head to replay your work on top of it...
Fast-forwarded main to upstream/main.

$ git log --oneline -n 5
1d5b458 (HEAD -> main, upstream/main) Merge pull request #106 from cbudz/main
b4c8087 fix catalog doc
58ac8c9 (origin/main, origin/HEAD) Merge pull request #102 from cbudz/main
07bf6d6 fix hub doc
f2b145b README: Link to mod-docs guide build

$ git push origin main
Total 0 (delta 0), reused 0 (delta 0)
cTo github.com:ariordan-redhat/red-hat-ansible-automation-platform-documentation.git
   58ac8c9..1d5b458  main -> main
⚠️ **GitHub.com Fallback** ⚠️