Pulling
Cloning an existing repository and pulling from a remote
We've covered how to push changes to a repository, but how about getting (pulling) changes from one you're already working on? Or what about downloading (cloning) an existing project on Github so you can start working on it? Let's go over cloning first:
Cloning
Cloning is very simple: just do git clone <REMOTE LINK>. For example, to clone the code for our central api run git clonehttps://github.com/Enactus-New-Beginnings/central-api. The project will be downloaded onto your machine in a folder titled "central-api". You can now start making changes to the code and push (if you have write access), as we covered earlier.
Pulling
To pull from a remote repository and get the most recent version of the code, just run git pull. As I mentioned earlier, git will try to merge your version and the pulled version automatically if there are conflicts. However, sometimes it cannot resolve merge issues on its own. In this case open the code in an IDE such as VS Code: it should let you manually decide how to best merge the files.
Last updated