How to Manage New Branches: A Guide for When You've Forgotten to Pull
Table of contents
Hi, Have you already switched to a new branch and are yet to pull?
Follow this guide to making progress on your work:
. Open VS Code and make sure you have the repository cloned and open.
. Open the Terminal in VSCode by selecting Terminal, then the new terminal from the menu or press Ctrl + `.
- Fetch the latest changes from the remote repository.:
git fetch origin
//This retrieves any changes from the remote repository without merging
//them
- Create a new branch and switch to it:
git checkout -b new-branch-name
//This creates a new branch and switches to it.
- Pull changes from the master branch into your new branch:
git pull origin master
//This command fetches the latest changes from the master branch on the
//remote repository (origin) and merges them into your current branch,
//ensuring you're up-to-date with the latest code.
- Resolve any merge conflicts (if any) and commit them. After that, you’ll have the latest changes from the master branch on your new branch.
You can now continue working on the new branch!
Short and straightforward!
I do hope you find it useful!
Happy Coding!🎉✨
Subscribe to my newsletter
Read articles from Oni Ebunoluwa Mercy directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
Oni Ebunoluwa Mercy
Oni Ebunoluwa Mercy
I am a front end developer and technical blogger at ebuntoday.hashnode.dev. I write to help new developers find their path to becoming better in their fields. Writing also keeps me abreast at each point in time. I am opened to constructive feedback,as this will go a long way in my growth. In case, you enjoy reading my articles and find any of them helpful, please like and share .