How to combine the contents of a file using git remote repository

40 views Asked by At

I'm new to git and I have some questions about git remote repositories.

Imaging A and B are colleagues and are working on a file. A is assigned to work on the 1st half of the file and B on the 2nd half. A completed his half before B did and published it to the remote repository. An hour later, B completed his half of the file, now B would like to fetch the file (that A published) from the remote repository and combine it with his work (2nd half of the file), is there a way to achieve this using only git commands?

1

There are 1 answers

2
skylerjiang On

Try git pull.

git pull is a Git command used to update the local version of a repository from a remote, it fetches (git fetch) the new commits and merges (git merge) these into your local branch.