Closed idea--list closed 3 years ago
PRs need to target the development branch. Master is only for releases.
To rebase your branch:
git pull --rebase upstream development
assuming you have upstream defined, if not, first add it with:
git remote add upstream https://github.com/ARMmbed/mbed-os-example-ble.git
I don't expect you'll have any conflicts but if you do you need to resolve them.
After your branch is rebased:
git push -f
to replace the old version at origin
will give git cli a try, though until now i only used github.com directly...
I am on a windows10 machine with Git bash installed.
For some reason i can not clone the repo using git commands, so i downloaded&extracted the .zip.
Then inside git bash i changed to the folder where i extracted the repo, typed git init
then git remote add upstream https://github.com/ARMmbed/mbed-os-example-ble.git
and also git pull --rebase upstream development
executed as expected.
However git push -f
results in:
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using
git remote add <name> <url>
and then push using the remote name
git push <name>
here i got stuck
@paul-szczepanek-arm Instead of fighting with git commands i installed "github desktop". Cloned this repo successfully, then i under Branch->rebase current branch i tried to change to the development branch but it tells me the development branch is up to date with master and does not let me rebase.
If i try to clone the development branch with github desktop, then it asks for my username&pw but does not let me clone the dev branch. Something might be missing.
If you cloned it with github desktop you can open the command line (in the repository menu -> open terminal) and use the git commands.
The original problem you had is because you didn't clone the repo you didn't have origin set up. You add it the same way:
git remote add origin https://github.com/idea--list/mbed-os-example-ble.git
With the one checked out with the github desktop version that should be already done so you can just issue the rebase command
I think the easiest solution is that i delete this PR, fork the repo again and then i edit the development branch in my fork and make a new PR based on that.
Rebasing is a very common procedure, it's worth learning it.
Are you sure you checked out your own fork and not this repo? I mean through the desktop version.
Are you sure you checked out your own fork and not this repo? I mean through the desktop version. Maybe that was the issue, let's see...
Still no luck:
git remote add upstream https://github.com/ARMmbed/mbed-os-example-ble.git
this returns: error: remote upstream already exists.git pull --rebase upstream development
in github desktop a popup is shown telling me there is a conflict with the mbed-os.lib file in each example folder.https://github.com/ARMmbed/mbed-os/
What is next? My guess is force pushing, but am not sure.
github desktop already adds upstream, that's why the error. It's fine. Now you have a rebased branch on your local machine you just need to push but you have to do it on the command line:
git push -f
The -f is short for --force-push which overwrites the branch at origin (github) with your newly rebased version on your local machine.
The command prompt tells me it is done. Is there anything else to do on my behalf?
Yes, remove the advertising part from the example.
Thanks for leading me through my first rebasing process! I will make the changes today on my local desktop and then force push once again.
OK, thanks. Force push is only needed if the remote has a different history from yours (which is what happens if you rebase - you change the history/base of your commits), otherwise normal push is enough.
Made the changes, updated the readme, pushed to my fork on github. Hope everything is fine this time.
Thank you. Tomorrow I will merge this to a separate branch temporarily to clean up the history a bit and then open a PR for development. I'll add you as reviewer when I do that so you can approve any changes I make.
Main purpose of this new example is to list which optional BLE features are supported by a device and showcases how one can access BLE related API members. It also starts advertising of non-connectable type and thus implements listening to only 1 event, which helps to understand the concept of event listeners before overwhelming the user with 10 different event listeners in the first example. As such, this example is aimed for those who just begin programming BLE with Mbed OS.