简体   繁体   中英

Github - After git clone, how to make a pull request?

I've read this . But it doesn't answer to what I've done and what I want.

I'm very new to git, and I've made a " git clone https://github.com/qmk/qmk_firmware "

Then I've created a new directory layouts/community/ergodox/azerty . In this directory I've created those files:

  • layouts/community/ergodox/azerty/keymap.c
  • layouts/community/ergodox/azerty/simple_visualizer.h
  • layouts/community/ergodox/azerty/README.md
  • layouts/community/ergodox/azerty/visualizer.c
  • layouts/community/ergodox/azerty/rules.mk
  • layouts/community/ergodox/azerty/config.h

Now I'd like to make a pull request for the maintainers to merge my "community layout".

I dont know what to do.

How contribute to GitHub repo:

  1. Fork the GitHub repo, you get the fork in your GitHub account
  2. Clone your fork
  3. Commit into your local repo
  4. Push to your fork
  5. Create pull request from your fork

See details: The beginner's guide to contributing to a GitHub project and Contributing .

And see my answer to similar question .

  1. Mark changes

    git add layouts/community/ergodox/azerty/*

  2. Make a commit with a very short description

    git commit -m "Short description"

  3. Push your changes to your GitHub project

    git push

Maybe you have to login now with your credentials.

  1. Make a pull request

Go to your project page on github.com and click the pull request button

Git is a distributed version control system, so your branch is just as valid as another branch on someone else's local copy of git.

To do this, you will need to do the following commands:

git add -A

to add the changes, then

git commit -m "Reason for change"

to commit the changes locally, then

git push

to "push" your changes to the remote copy of the branch in which you are working. If this branch only belongs to you (ie, not the origin) then you really don't need to do anything else.

If pull requests are not enabled for the project, then you simply need to checkout the destination branch, perform the merge, and then push those changes to GitHub. That is,

git checkout <DestinationBranch>
git merge <SourceBranchWithYourChanges>
git push

However, if pull requests are enabled on the repository, then only certain people will have the ability to merge into the origin\\master (or whatever the name of the branch is).

To do this, you need to log into GitHub and then follow the instructions that GitHub provided (specified in the link within your question). This will prompt a user who can merge the request to merge your changes into the appropriate branch for more general consumption.

As you may have read from the page you linked, you need to fork the repo before you can create a pull request to a repo that you don't own. Here is what I would do in your situation

  1. Fork the repo on github.com
  2. Clone the forked repo to your computer
  3. Copy the folders .git and .github in the repo you just downloaded into the repo which you cloned and edited and overwrite the original ones
  4. Now, you may add, commit, and push (or perhaps create a new branch, following the official instructions) in the repo where you made your changes.
  5. Finally, go to github.com and create a pull request.

Tested and no issue.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM