Hi, when i follow the steps in <https://github.com...
# shuttle
c
Hi, when i follow the steps in https://github.com/efabless/caravel_user_project/blob/main/docs/source/quickstart.rst for creating a github repository from the caravel example I end up with a separate branch from the main one in my github repo main, and I can't complete the pull request? Is there a way to replace the main branch with the one i've created? Also, why is the command
"git push -u origin <my_branch>"
used to push the cloned caravel project to our personal repo? I thought it was renamed to upstream so it should be
Copy code
git push -u upstream <my_branch>
?
1
m
This is my understanding.
Copy code
# Make sure that "caravel_example" matches the empty github repo name in step 1
git clone -b mpw-5c <https://github.com/efabless/caravel_user_project> caravel_example
cd caravel_example
So right here, your local repo is equivalent to efabless's repo, and has a pointer to that repo defined as the
remote origin
Copy code
git remote rename origin upstream
Here you rename the pointer to efabless's repo to
remote upstream
. You won't (and actually cannot) push to this repo.
Copy code
# You need to put your empty github repo URL from step 1
git remote add origin <your github repo URL>
Here you add a pointer to your repo called
remote origin
(it used to point to efabless's repo, but we renamed it.)
Copy code
# Create a new branch, you can name it anything
git checkout -b <my_branch>
git push -u origin <my_branch>
Here we add a tracking pointer to origin for
my_branch
. Any future
git push
commands will go to our repo (
origin
) by default.
As per your original question, I believe it's possible to create a pull request from a different branch. You'd create the pull-request to your main from my_branch.
c
@User Does that mean I should name my_branch as "main" if I want to push to my main repo branch ?
m
@User I'm not an expert, but I believe the short answer is "yes". The long answer involves setting up remote tracking. git is usually pretty good at telling you what to do if you try something that doesn't work, so maybe just try it.
👍 1
c
Okay thanks!