dyno8426
dyno8426

Reputation: 1249

Git: Pulling changes into a newly cloned bare repository from an existing (similar) repository

I was originally working on a repository (say /path/to/d_orig) and maintaining versions on it using Git. I wish to move into a newer version of the repository which has been updated by others and contains some major changes.

In order to keep my current version and the newer version separate, I have a cloned from the bare repository of the newer version at a different location (say /path/to/d_bare). After cloning, how can I pull/merge the changes from d_orig to d_bare?

Upvotes: 3

Views: 59

Answers (1)

Ajinkya Dhote
Ajinkya Dhote

Reputation: 1478

You can add a remote of origin repo in your bare repo like this.

git remote add origin_repo <git url of origin repo>

Once the remote of origin repo has been added you can pull the changes from origin repo into your bare repo like this.

git pull origin_repo <branch-name>

Here origin_repo is the remote we have added which refer to your origin_repo, you can have your own name also for the remote.

Upvotes: 3

Related Questions