I have a feature branch on git and I set is as a Pull Request.
I've made 3 commits to the feature branch but the latest commits are not showing up in the pull request page.
Is there a way to update my pull request to show the latest commits from the feature branch?
Check first your git status
you must be on the feature branch and not on a detached HEAD
your branch should be ahead of origin/feature branch
the remote feature branch should be the one from which the PR has been initiated.
Related
Commit Merge branch dev from my-branch
2 pull requests from my-branch to dev and master branch
Hi everyone,
I have problem when pull request from my branch to dev and master branch. It was occured 1 commit is Merge branch dev into my branch - I hadn't pull request it yet. That's odd.
Base on first image, you can see the title is commit dev from my branch (So, It means I created a pull request). But in the commit, we can see a commit named "Merge branch dev into ...".
And I don't know how to check it, because it only has one Pull request to merge code (into dev from my-branch).
My process is :
Switch master (git checkout master)
Pull from master (git fetch -p and git pull)
Create new local branch from (git checkout -b my branch)
Push to GitHub (git push origin -u HEAD)
Pull request (first is into dev from my branch, second is into master from my branch)
The different with other my pull requests is this pull request have many conflicts I need to fix manually.
I'm not sure if I wrong at what step?
And I have last question, how we can block pull request from dev to another branch?
Thanks so much.
I just wonder why it has Merge branch dev, It makes code was wrong.
And could anyone tell me know how to block pull request from dev to another branch?
I made some changes to several files of the project on a new branch (let's call it branch_a), I commited them, created the Pull Request, and it was recently reviewed and approved. It's still pending Merge on the master branch.
Now, someone asked for another change. It's a small supplemental change in 1 of the files edited in the first Pull Request.
What's the best way of doing this? Should I ask for the first Pull request to be merged and then create a new branch (branch_b), make my change and create a new Pull Request, ask for review and merge again?
Or is there a "cleaner" way, when the first Pull Request is somehow merged with the second one and we don't have to make 2 different merges?
If another change requested is a part of the same feature as in ‘branch_a’, then you can simply make change in the same branch, your PR request will show up those changes, but PR approval will be required again.
If another change requested is outside the scope of feature ‘branch_a’ and it is just a file is same between two changes, then you can create a new branch out of master say ‘branch_b’, complete your changes and raise PR for the same. After ‘branch_a’ is merged into master, you can rebase your second branch ‘branch_b’ to include updated master codebase into branch_b, (or vice-versa if branch_b is merged first).
This is especially useful if the order of merge is not decided in advance.
Below are the steps, for rebase, here ‘feature_branch’ is the name of your branch for which you want to perform rebase:
git checkout master
git pull origin master
git checkout feature_branch
git rebase master
Here you might get some conflicts(if there are any) multiple times as per number of commits in your feature_branch. You can resolve the conflicts manually and proceed with further process of rebase with below command:
git rebase --continue
At any point if you think that things are not going well and you would like to cancel rebase process, then execute below command:
git rebase --abort
Finally when all conflicts are resolved and you get message as successfully merged, then execute below command to push changes to origin:
git push --force origin feature_branch
for more information on rebase process follow link:
https://www.atlassian.com/git/tutorials/rewriting-history/git-rebase
Branch off the first pull request branch, edit, add, commit, push, and ask for a second PR merging to the first branch. When the first branch is merged the second PR will be reconfigured automatically (by GitHub) to be merged into the main branch.
I'm new to Github and I have a branch that I want to merge with the master. I couldn't merge it via git command line, its very complicated.
I tried to merge it on Github site following below documentation:
Merging a pull request on GitHub
But I got the following message:
There isn’t anything to compare!
Here's the project:
https://github.com/SumayahAlharbi/erecords
What does 4 commits behind master mean?
Update
Please check below pictures:
I thought I did the merging successfully but nothing changes!
What does 4 commits behind master mean?
It means that the master branch has 4 commits which are not present in your branch currently. You need to rebase your branch and then create a New Pull
Request which will be needed to be reviewed and finally approved so
that your branch can be merged with the master.
There isn’t anything to compare!
Check the difference between the master and your branch. Click the Compare icon in Git hub or run this
command from your local branch in Git Bash : git diff --name-only master_branch.
I just checked your repo. The changes of ExportFeature branch are already merged into the master branch, and then the merge is reverted. That's why now if you raise a pull request to merge ExportFeature into master, you would get There isn’t anything to compare!.
See the latest commits on ExportFeature which are already present in the master branch.
The reason you are seeing 4 commits behind master on ExportFeature branch is since the master branch has 4 more commits than the ExportFeature branch. If you see the total commits on ExportFeature branch, it's 7, whereas the total number of commits on the master branch is 11. If you need to do any more changes on the ExportFeature branch, you would need to get the latest changes from the master branch by running the command git pull origin master when your current branch is ExportFeature on your local git terminal.
I have forked a master from upstream. I have created a branch, made some commits, and now want to issue a pull request. I want to know when my branch is merged by the user, will it get merged to the upstream master, or the user will have an option to create a new branch and merge my branch with it? Btw, I don't have push permission.
Where the Pull Request merges depends on how you create it, when you pick four things:
The base fork: Which fork of the repository the PR will be merged into
The base branch: Which branch in that repository the PR will be merged into
The compare fork: The fork with thew new code
The compare branch: The branch containing the new code
So if you configure the base to be upstream_repo:master, yes, when the PR is accepted, it will be merged to master.
For more, see GitHub's help on Using Pull Requests.
I want to clone/merge branch for my git repository inside github, for example merge updates in draft branch to gh-pages for publish.
And in some cases, I don't have access to command line for git command.
Is it possible to achieve this online ?
You can merge branches in GitHub using a Pull Request as long as the merge doesn't create any conflicts.
To merge a pull request on GitHub:
Create a Pull Request to merge the draft branch into the
gh-pages branch.
If it can be merged online, you'll see This pull request can be automatically merged. and a Merge pull
request button.
Click the button and you'll have a chance to Cancel the merge or add a commit message and Confirm Merge.
If you choose to Confirm Merge, the Pull Request will automatically close.
For more information, visit Github's Merging a Pull Request Help page.