user1592380
user1592380

Reputation: 36357

Import github project into preexisting git project

enter image description here

I'm working on a flask app in a local git repo. I've come across a python script that I would like to import into my project root from github. I'm not sure how to "pull in/import" this script into my local repo, without affecting my pre-existing code. Can someone advise me here. Is it as simple as

git clone https://github.com/xxx/yyy.git

( I don't want to try for fear of messing up my local repo )

Upvotes: 0

Views: 54

Answers (1)

Rob Day-Reynolds
Rob Day-Reynolds

Reputation: 26

You can add an additional remote branch to your repo:

git remote add <yyy> https://github.com/xxx/yyy.git

Once that's done, you can pull directly from your new remote with:

git pull <yyy> master

This will automatically attempt to merge the code from the remote repo into your local repo.

Upvotes: 1

Related Questions