Day 14: VCS - Git Mastery
The blog aims to provide readers with a comprehensive understanding of Git, a powerful version control system widely used in software development.
Whether you are a beginner or an experienced developer, this blog will equip you with the knowledge to ...
techwithankush.hashnode.dev8 min read
Q&A:
git clone vs fork In short, git clone brings the project to your computer, while fork brings the project to your account on the remote server. Both serve different purposes in the collaborative development process.
git merge vs rebase Merge : Combining changes from one branch into another branch. Rebase : Moving or replaying your changes on top of another branch. (Linear history)
git diff vs status git diff : shows the differences between your working directory and the last commit (or between different commits or branches). git status: gives you an overview of the current state of your repository.
git pull and fetch git fetch: only downloads the latest changes from the remote repository, allowing you to inspect and merge them manually if desired. git pull : downloads the latest changes and automatically merges them into your current branch.
git cherry-pick vs stash git cherry-pick: lets you pick a specific commit and apply it to another branch. git stash : lets you save uncommitted changes temporarily and then retrieve them later.
git reset vs revert git reset moves the branch pointer to a specific commit, potentially discarding commits (use with caution). git revert creates a new commit that undoes the changes from a specific commit, keeping the commit history intact. 
Working Repo: DevOps.txt I am Ankush I am 30yrs old
In above example, same file having different line in code due to which conflict occurs while pushing the code. To resolve it follow below steps:-
a. git pull origin remote-branch b. Resolve the conflict in the working repo which are correct and required. c. git merge OR git add . & git commit -m “Resolve the conflict”
NOTE: To avoid any merge conflict in your project, it is always recommend to ‘’git pull origin branch-name’’