Git interactive rebasing
- HEAD~n => represents going back n commits.
- Actions that can be performed
- pick -> use the commit as it is
- reword -> change the commit message
- edit -> pause and lets you ammend the commit
- squash -> combine the commit into previous
- drop -> remove the commit entirely
- To perform interactive rebasing the command is
git rebase -i HEAD~n
- This opens an editor
- Merge conflicts in rebasing have to fixed added to the staging area and then
git rebase --continue - Rebase can be aborted using
git rebase --abortin the cases of conflicts or edits - Refer Here for interactive rebasing.
- Note: Be extremely careful while doing interactive rebase of public branches.
Exercise:
- Create a repo
- Create 5 commits on main branch
- now create a rel_v1.0 and create two commits
- now merge the changes from rel_v1.0 to main
- I want to revert the merge.
- Refer Here for reflog
Git Remote Repositories
- A Remote Repository is another git repository located any where
- Popular Remote Repositories:
- Cloud Hosted Solutions:
- GitHub: Create Account
- Gitlab
- BitBucket
- Azure Source Repos
- AWS Code Commit
- Self Hosted Repostiories:
- Gitlab
- Gitolite
- …
- Cloud Hosted Solutions:
- To be continued….
