Git scenario cheat sheet
To live in hearts we leave behind is not to die
Merge
git merge new_feature
Let's say, we want to copy all the code from
new_featurebranch intodevbranch.In such a situation, first, we have to
checkoutindevbranch then we can execute the above command.The above command means bringing all the changes from
new_featurebranch into the current branch.Note: always pull before any merge i.e. after
git checkout testdo a pull requestgit pullafter that dogit merge new_feature
Remote branch
You have a lot of branch in you remote but when you did git clone <repo-url> and git branch. You can only able to see main branch. Now you want to see all the branch in your local machine.
for branch in `git branch -r | grep -v '\->'`; do
git branch --track ${branch#origin/} $branch
done
git fetch --all
