3

Ok, so I have a cloned github repo on my local machine, and another forked github repo in my github account. I would like to push a file from my cloned local repo to my forked repo. I need to push it in the same location (e.g. the file in my local repo is in /folder1/folder2 and I have to push it in my forked repo in /folder1/folder2). Does anyone now a way to do this?

Thanks!

Vynillius
  • 33
  • 2
  • Copy it to your forked repo, `git add`, `git commit`, `git push`. – Justin ᚅᚔᚈᚄᚒᚔ Feb 01 '13 at 20:20
  • well, I tried that but, after git push, it doesn't let me to push it, it tries to push it in the source of the cloned repo. And the forked repo is online, not on my local machine. But I will try to clone it, and than make these changes – Vynillius Feb 01 '13 at 20:24

1 Answers1

1

You can clone your fork, and as Justin ᚅᚔᚈᚄᚒᚔ comments, add, commit and push.

If you try to push from your current local clone, its main remote address (the 'origin') refers to the first GitHub repo, and not your fork.

But you could do it from the same repo, by adding to your current local clone the address of your fork:

git remote add fork https://github.com/user/myFork

, and push there:

git push fork master.

enter image description here

See also "What is the difference between origin and upstream in github".

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250