Open MichaelPachec0 opened 2 years ago
ugh just to make sure that the documentation is correct, there was a mistake in the docs where it was not specified that it was needed to have this repo added as a remote and that it was needed to specify the remote repository (in this case upstream) when fetching. It meant that everyone wasn't pulling from the latest sources. Well that is fixed now in the documentation.
It has come to my attention that for more intricate issues, there have been issues with sending PRs to the repository. I will outline 3 ways to create clean PRs and their pros and cons.
Deleting and reforking from Upstream (this repository). I figure most of you know how to do this and probably are doing this.
Steps:
Pros:
Extremely easy to do
Can be automated
Do not have to worry about git getting in the way of committing
Cons:
Git isnt getting in the way when committing
There is a much better way of doing this without reforking.
git fetch origin master:master
can be used to update the master branch even if you are not in the same branchgit branch -D <branch-name>
git checkout -b <branch-name> master
--force
when pushing--force
git push origin --all
remembering that you need--force
if your deleted branch and new branch are the same.Better way 1: using
git merge
.git fetch upstream master:master
can be used to update the master branch even if you are not in the same branchgit remote add upstream git@github.com:MichaelPachec0/nodejs-project-night.git
git merge master --no-edit
will do thisgit merge --abort
will do this for you and you can start over.git merge --continue --no-edit
Better way 2: using
git rebase
.git fetch upstream master:master
can be used to update the master branch even if you are not in the same branchgit remote add upstream git@github.com:MichaelPachec0/nodejs-project-night.git
rebase
git rebase master
git status
to see which files have been marked as modifiedgit add \<file\>
to add the files, or all at once usinggit add -u
git rebase --continue
git -c core.editor=true rebase --continue