Monday, May 17, 2021

Git Basics - Fast forward mege

git checkout -b title-change

- will create a new branch "title-change" and checkout to it.

git status - verify - we are on "title-change" branch

mate sample.html

change title "example website"

git status --> changes to commit, modified: sample.html


git commit -m "change title"

git log --oneline  -> verift commit


git checkout master

git diff master title-change

Now you are in 'master' branch

git merge title-change


Fast-forwad merge -->  when no changes are present


git log --oneline --graph --decorate


'HEAD" is pointing to latest commit on the current branch, and both the "title-change'

'master'  currently pointing to that commits as well

we have merge, so we do not need. let's delete

git branch -d title-change

git branch  --> only see master

git log --oneline --graph --decorate  --> see only 'master' and 'HEAD'

No comments:

Post a Comment