Question

I am having troubles using pull request using the git command line. Let's say I have a branch called 'stable' that acts like my master branch. So I have a branch called 'mybranch' coming out of stable. I update my code in 'mybranch' and now I want to make a pull request for my branch to stable using the git bash command line. I use github as my git repo. I tried the following:

git checkout stable

which makes me to be on the stable branch. To make a pull request for my branch i use the following command:

git pull origin mybranch

and then, I update the stable branch to the github repo as: git push origin stable that pushes my 'stable' branch on github. However, I cannot see my branch being merged or being pulled to the stable branch. I don't know If I am doing something wrong. Any suggestions ?

No correct solution

OTHER TIPS

To merge mybranch to stable, just using

git commit -m 'last comment'
git checkout stable
git merge mybranch

Phew! You have mixed a lot of things :-)

  1. "git pull" is different from github pull-requests
  2. what I udnerstand from your question is:

    • you need to create a branch ( git checkout -b mybranch )
    • update some code there ( edit any file )
    • add the changes to stage ( git add "filename" )
    • commit them ( git commit -m "message for commit" )
    • push the branch to github ( push push origin mybranch )
    • go to github.com and create a request to get your code reviewed in github ( read: pull-request )
    • above step can also be done using command line using "github hub"
    • merge your mybranch to stable from github web interface or using "github hub"
    • come back to stable branch ( git checkout stable )
    • pull the latest changes for your stable branch ( git pull )

Caution: Too much mixing of concepts is very injurious to health :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top