Reputation:
After i commited certain files/changes to a remote branch through the Github Desktop App, i would like to get those changes to the local branch. I do work with SAP Web IDE.
What i tried:
fetch
Issue: Didn't really work out
Question: How to get the data of the remote Branch to a local Branch ?
Upvotes: 0
Views: 598
Reputation: 1693
There are several ways to retrieve data from remote
branch to your local
branch.
The simplest one is pull
. Just run the following command.
$ git pull
Another way to do it is to merge
. But before you have to fetch
.
$ git fetch
$ git merge
You can also use rebase
. It also requires fetch
.
$ git fetch
$ git rebase
Another interesting way is to fetch
your remote branch and reset
your local branch to the remote
branch. Lets just say, your local branch is sample
. Then just run the followings.
$ git fetch
$ git reset --hard origin/sample
Upvotes: 1
Reputation: 81
Use git fetch
to update your local references to the remote branch. In other words: git fetch
checks for updates on the remote repository, but does not yet merge any updates to your local repository. After fetching, use git merge
or git rebase
to integrate the remote changes into your local repo.
https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes
Upvotes: 0