# Git Update Branch While On Other Branch

I have those moments quite frequently, I need to update my `develop` branch, but I don't want to switch to it in git.

Well, I discovered a way to fetch another branch you’re working in, but you don’t need to switch.

```bash
git fetch origin develop:develop
```

With this command, you can continue to work in your feature branch and update the `develop` or `master` branch. No need to stash your current changes because you need to switch branches anymore!

It’s super easy and valuable to me. I thought It might be helpful to you as well 👍

---

### Git 101

If you want to grow your Git skills on the terminal, then check out these posts (with videos 📹):

1.  [Setup Git, create repo local and remote repository](https://blog.byrayray.dev/git-101-step-1-setup-create-repo-local-and-remote-repository-4e15fcad89b6)
2.  [Add, stage, commit & push](https://blog.byrayray.dev/git-101-step-2-add-stage-commit-push-aab3afeece55)
3.  [Branches](https://blog.byrayray.dev/git-101-step-3-branches-634055e32ec)
4.  [Merging branches, merge conflicts & cherry-pick](https://blog.byrayray.dev/git-101-step-4-merging-branches-merge-conflicts-cherry-pick-67cc1ff0edb7)

---

## Thanks!
![hashnode-footer.png](https://cdn.hashnode.com/res/hashnode/image/upload/v1629789655319/nBF6anHH4w.png)
*I hope you learned something new or are inspired to create something new after reading this story! 🤗 If so, consider subscribing via email (scroll to the top of this page) or follow me here on Hashnode.
*

> Did you know that you can create a [Developer blog like this one, yourself](https://hashnode.com/@devbyrayray/joinme)? It's entirely for free. 👍💰🎉🥳🔥

*If I left you with questions or something to say as a response, scroll down and type me a message. Please send me a [DM on Twitter @DevByRayRay](https://twitter.com/@devbyrayray) when you want to keep it private. My DM's are always open 😁*

