Please DO NOT commit to upstream directly -- use pull requests #41
vijayxtreme
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
@team-hack/developers - As a reminder: Please do not directly clone the team-hack repo and do not make direct commits via the main branch or your own feature branches.
Here's what to do instead
Instead, fork the team-hack repo (e.g. react-components to your own account, then clone it to your local computer. From there, check out a new branch via:
git checkout -b <mycomponent branch>.You'll also want to set up two remotes:
originand anupstream.originis where you'll push your feature branch aka<mycomponent branch>-- so origin is your repo.upstreamis where you fetch and merge updates from the team -- so upstream is the team's repo.Work on Your Feature, Make a Pull Request
Work on your component until you are done, making sure to write code, test and resolve any local conflicts from upstream. Then make a pull request. Here's the order in how to do it:
Note: Using
git log --onelinehelps verify your local repo is at the same point as upstream. You can keep youroriginmain up to date by doinggit push origin main.Now that your
mainbranch is up to date, view this code in your favorite code editor. Try the code also out -- for example with our Storybook project, you can runyarn storybookfrom your command line to see the repo at this point. Fix any local merge conflicts as well.Merge your code into your feature branch (if not up to date)
Again fix any merge conflicts locally.
Make A Pull Request
Now you can submit your feature branch! Yay!
Simply:
Go to your
originrepo and you should see a button or alert letting you know you can make a pull request. Click the button or alert.In the next page, you can verify you want to make a pull request and leave any comments for the code you are sending. Submit if you are good to go.
We Review The Code
We will then review your code and if we have any feedback, we will leave for you in the comments. If the pull request needs more work, we will close with comments / instructions on what to fix and you will need to then locally fix and submit a new pull request.
If the pull request has no errors, we will merge into the main
upstreambranch. Everyone then should be sure to update their own repo as necessary.Thank You
Thanks! Please leave any comments here or if you find any errors in this discussion, let me know.
Beta Was this translation helpful? Give feedback.
All reactions