David Y.
—In my Git repository, how do I fetch a branch from a remote to start working on locally? There is no equivalently named branch in my local repository.
We can do this using git fetch
to retrieve the remote branch and git switch
to work on it locally. First, fetch the remote branch:
git fetch remote-branch
Then switch to it:
git switch remote-branch
Under the hood, this command will create a local branch named remote-branch
, which tracks the version of remote-branch
on the repository’s remote, and check it out. We can then make commits, push them, and pull others’ commits from this branch as usual.
Tasty treats for web developers brought to you by Sentry. Get tips and tricks from Wes Bos and Scott Tolinski.
SEE EPISODESConsidered “not bad” by 4 million developers and more than 100,000 organizations worldwide, Sentry provides code-level observability to many of the world’s best-known companies like Disney, Peloton, Cloudflare, Eventbrite, Slack, Supercell, and Rockstar Games. Each month we process billions of exceptions from the most popular products on the internet.