41. Pulling shared changes
Goals
- Learn how to pull changes from the shared repository.
Quickly switch to the home
repository and pull the changes we just sent to the shared repository.
Run
cd ../home
We are now in the home
repository.
Continue with...
Run
git remote add shared ../work.git
git branch --track shared main
git pull shared main
cat README
Result
$ git remote add shared ../work.git
$ git branch --track shared main
Branch 'shared' set up to track local branch 'main'.
$ git pull shared main
From ../work
* branch main -> FETCH_HEAD
* [new branch] main -> shared/main
Updating 71df43a..d9d2bea
Fast-forward
README | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
$ cat README
This is the Hello World example from the Git tutorial.
(changed in the origin and pushed to shared)