Reputation: 313
I have two local Git repositories. I cloned one from the other with the command:
git clone /path/to/local/repo/1
I made a couple of changes to each Git repository. Now I want to merge/update the changes of local_repo_1 to local_repo_2 (i.e. in this scenario, local_repo_1 is like a remote git repo that I want to pull the changes from). Is there a way to do this?
I have tried the following:
git add --all
git commit -m "message"
git fetch /path/to/local/repo/1
git pull
I get the response "Already up to date". So how do I update my local Git repo from another git repo? Is there a way to do this?
Upvotes: 3
Views: 1274
Reputation: 141986
Why not using branches? you can achieve the same thing but working on different branch rather then new repo.
Once you done you must commit your changes and them merge them together.
But once again - use branches instead of new repository.
create branch: git checkout -b <new_branch>
, make your local changes on this branch and then git add ...
, git commit ....
and once you done with it merge them together `git merge '
Upvotes: 2