Welcome to the Question2Answer Q&A. There's also a demo if you just want to try it out.
+1 vote
1.3k views
in Q2A Core by
edited by

Hi Scott and pupi1985, I saw that you are already familiar with github. I am new to the subject... What I did so far:

1. installed software github for windows

2. went on https://github.com/q2a/question2answer + clicked on fork

3. opened github for windows and cloned "question2answer"

4. did my changes to the code (...)

5. now want to push back to the repo, however, it shows only the option to commit to "master" (NOT dev branch showing up?!)

6. I commited the changes to my master: https://github.com/q2apro/question2answer (which is the fork)

7. Now I want to create a pull request to the official dev branch of q2a

Here I am stuck.

 

PS: This is my fork with the changes: https://github.com/q2apro/question2answer/commit/0b87d622444b23773a0b2fdccf269da9b029cd12

2 Answers

0 votes
by

Good, I found it in the github docs: https://help.github.com/articles/using-pull-requests/#initiating-the-pull-request

1. Switch to your branch

2. Click the Compare & review button

etc.

That was hard to see!

 

Also I had to choose "Dev" from top as "master" was there by default. (Click Edit button on the right):

 

Problem is that - comparing my fork with the dev-branch - shows me some commits of gidgreen, that my pull request would "revert"...

https://github.com/q2apro/question2answer/compare/q2a:dev...master

Did I make a mistake when forking?

0 votes
by
Based on the screenshot and your comments, it seems you have commited in your master branch. You should create a new branch for the pull request. I don't know how to do that with an UI cliente but from the console you should do something like:
 
1. Clone your repo
 
git clone <url>
 
2. Checkout the dev branch
 
git checkout dev
 
3. Create a branch for the pull request
 
git checkout -b whatever-name-you-want
 
4. Modify the files
 
5. Add the files
 
git add .
 
6. Commit the files
 
git commit
 
7. Push the new branch to your repo
 
git push -u origin whatever-name-you-want
 
8. Go to GitHub and you'll see the pull request button there. Then just choose the dev branch from the q2a repo and the whatever-name-you-want from your repo
 
That's it (unless I have missed a step).
by
Thanks pupi, I have solved it by: committing into my repo's DEV branch as well. In the Github UI client there is a dropdown from which I switched (from master) to "dev" *before* committing. After the commit I was able to do the pull request from my dev branch to the q2a dev branch from github.com

Here is the correct pull request: https://github.com/q2a/question2answer/pull/146
by
The thing is that if you don't create a separate branch you will end up appending new commits to dev so new pull requests will have previous commits too
...