cade galt
cade galt

Reputation: 4171

Can I push a local repo to another repo?

I'm learning git and just experimenting, so there is not real reason I need to do this yet:

I tried running

git push path_to_local_repo master

form a different local repository.

I got this error:

enter image description here

Why is git angry?

Upvotes: 0

Views: 63

Answers (2)

tarleb
tarleb

Reputation: 22609

The problem is that you are trying to push to the currently checked-out branch in the other local git repo. Possible work-arounds: push to a different branch and then manually merge that branch into master

git push ~/root-working master:godaddy-master
cd ~/root-working
git merge --ff-only godaddy-master

or just go into the other folder and pull from there

cd ~/root-working
git pull ~/root-godaddy

Upvotes: 1

sTodorov
sTodorov

Reputation: 5461

You want to push a local repo to another remote repo, right?

If so:

git push [remote] branch_name

Upvotes: 0

Related Questions