Click here to Skip to main content
15,888,521 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Okay, so here it goes. I was told to clone a repo and work on it. So I cloned it using:
git clone https://github.com/group/group_project.git 
. After editing more than 10-12 files, I was told to make git-pull-request. Now because I had cloned before forking and then cloning, I needed to make my local repository (repo in my machine) be added to a remote repo. To resolve it I forked the group_project repo into my account. Then used the forked repo URL to add my local repo to the forked repo URL by the following:

git remote add origin https://github.com/me/group_project.git


There were some errors so next time I did with:
git remote add my_task https://github.com/me/group_project.git

And then to verify I ran the command
git remote -v
. And the results turned out to be:
group_project     https://github.com/me/group_project.git (fetch)
group_project     https://github.com/me/group_project.git (push)
my_task           https://github.com/me/group_project.git (fetch)
my_task           https://github.com/me/group_project.git (push)
origin            https://github.com/me/group_project.git (fetch)
origin            https://github.com/me/group_project.git  (push)


Anyways I created a branch with
git branch taskId
.And added, committed and pushed the files using
git push my_task taskID
. I successfully even pulled the request.

But when I when run the command
git checkout my_task 
I get the following:
error: pathspec 'my_task' did not match any file(s) known to git


So, will I be able to fetch from upstream to my master branch?

What I have tried:

I tried to run this command:
<pre>git checkout  
as well as
<pre>git checkout master 
Nothing proved git to be aware of my master branch
.
Posted
Updated 13-Jan-22 21:20pm

1 solution

It's probably easier to use the Fork button on the top-right in GitHub.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900