Understanding who is doing what, with Github and MatrixPilot

56 views
Skip to first unread message

Peter Hollands

unread,
Oct 2, 2015, 5:35:36 AM10/2/15
to uavdevb...@googlegroups.com
Folks,

Recently Bill asked an interesting question in a private chat. With GoogleCode we had one location for updates so it was easy to see who was making updates to the main trunk and branches. His question was "How can I see in one place all the updates to MatrixPilot on github", when everyone is working with "Forks" and have their own copies of the repository ?

Well the answer is Github will show you that on this page. I enclose a link to a screenshot of that page below.

The page shows you all the changes that have happened in individual Forks of MatrixPilot across Github in date order.

You should note that the page can be dragged with a mouse (click and hold with left button and drag), drag from left to right, and the graph will show previous periods of time.

You will see in that graph, that "Inspirati", Robert Dickenson, has made the most recent change on his own fork. While before that you can see that Kees has been updating various branches in his account. 

Best wishes, Pete




Screen Shot 2015-10-02 at 10.32.43.png

Mark Whitehorn

unread,
Oct 2, 2015, 12:03:38 PM10/2/15
to uavdevb...@googlegroups.com
Hi Pete,

FWIW, my latest version of MatrixPilot release 4 is here: https://github.com/kd0aij/MatrixPilot but it predates the new MatrixPilot git repo and hence is not a fork. I'm not sure if it's worthwhile (or even possible) to reintegrate at this point.
I was most recently working in branch "mw4" (the default), and last commit was about 10 months ago.
This branch began in October 2013 with a port of the fly-by-wire control logic from MatrixPilotMulti into the fixed-wing code.

best regards, Mark


--
You received this message because you are subscribed to the Google Groups "uavdevboard-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uavdevboard-d...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Hollands

unread,
Oct 3, 2015, 7:43:22 AM10/3/15
to uavdevb...@googlegroups.com
Mark,

It would seem that your export of MatrixPilot from googlecode to github ended up with different commit ID's (different SHA1 message digests).

My exported git ID for that commit was:-    b7f31c638b1b09ce964cb280934fbd373a38c4da
Your exported git ID for that commit was:- 3d389586eca95144c60840820ea1ce9f5fbe0695

This difference in git commit messages between your export and the one that I did is something of a mystery. The git-svn-id appears embedded in the commit log message of my export on github, and is not in your export.  I am not sure why that has happened.

But the result is that, sadly, it is not possible to easily integrate your mw4 branch backinto a branch of MatrixPilot/MatrixPilot on github with the tree's meeting up in the history correctly. I think that if the commit ID's had been the same it should have worked. After all git is designed specifically to be a distributed version control system.

Best wishes, Pete
Screen Shot 2015-10-02 at 22.14.46.png

Leonardo Garberoglio

unread,
Oct 3, 2015, 2:14:22 PM10/3/15
to uavdevb...@googlegroups.com
Peter, now I can see when Robert makes changes on his code. How do I do to see a diff to my recent code? how do I have to do to update my code with his code?

Thank!

Peter Hollands

unread,
Oct 3, 2015, 4:07:12 PM10/3/15
to uavdevb...@googlegroups.com
Leonardo,

You can use the "Compare" button on the right of your main screen in github as shown in the screenshot below.

You can compare any of your branches to any of anyone else's forked repositories and their branches.
(see my second screenshot below).

Here is one result (but not sure what branch of Robert's you wanted to compare).

Best wishes, Pete




github_compare.jpg
Screen Shot 2015-10-03 at 21.04.22.png

Leonardo Garberoglio

unread,
Oct 3, 2015, 5:35:42 PM10/3/15
to uavdevb...@googlegroups.com
I'm trying to compare Roberts nucleo branch with my nucleo branch. It seems to be the same, but on this screen seems that Robert make changes recently:
https://github.com/MatrixPilot/MatrixPilot/network

what am I don't understand?

sorry for all of this questions, but I'm still reading trying to understand git :-(

Tom Pittenger

unread,
Oct 3, 2015, 5:52:56 PM10/3/15
to uavdevb...@googlegroups.com

What you guys have are two branches with the same name that are diverging from each other. What you need to do is both work on the same branch. Either you host or he hosts. While git supports dual hosting, it makes life easier if you just work on the same branch from a common parent.

Robert Dickenson

unread,
Oct 3, 2015, 5:54:56 PM10/3/15
to uavdevb...@googlegroups.com
'morning guys (-:

Leo, perhaps you can sync from my repo using fancy git commands.

Otherwise for now, you could simply clone my current working set directy:

https://github.com/Inspirati/MatrixPilot/tree/MatrixPilot_nucleo

Hope this help, Robert.

Robert Dickenson

unread,
Oct 3, 2015, 5:58:51 PM10/3/15
to uavdevb...@googlegroups.com
Hi Tom,

Sorry i missed you guys the other day for git chat )-:

Can Leo directly commit to my github accounts branch (nucleo in this case), or send pull requests to mine alone?

Should we both commit to our own accounts fork of MatrixPilot::MatrixPilot and sync from each other??

Thanks, Robert.


Tom Pittenger

unread,
Oct 3, 2015, 6:50:42 PM10/3/15
to uavdevb...@googlegroups.com
Robert,

We're at a point where we have a mixed SVN branch layout which is not how GIT does things. Basically, we need to uniform things up. In theory experimental branches should be in your own repo and not in /matrixpilot/matrixpilot although nothing keeps us form doing it except for trying to keep the chaos at a minimum.

If the two of you are working on something, or he is helping you (or vice versa), then he should have a clone of yours and hten commit back to it. You can give him access and he can do it directly or he can make a sub-branch and push changes to it via PullRequest to your branch where github will merge them in. You would then pull and it would fetch+merge. Try to never merge manually, it usually just makes things worse. Let github handle that.

I've pinged you on hangouts. ACK me if you're free.

-TomP




Leonardo Garberoglio

unread,
Oct 3, 2015, 6:54:44 PM10/3/15
to uavdevb...@googlegroups.com
Well, it's seems that I'm far far away of understand all of this git stuff.
So I will wait for instruction on how to proced to colaborate with Robert nucleo branch.

Thank again!

Robert Dickenson

unread,
Oct 3, 2015, 8:08:18 PM10/3/15
to uavdevb...@googlegroups.com
Leo, please try making a clone of my branch at:

https://github.com/Inspirati/MatrixPilot/tree/MatrixPilot_nucleo

Then try submitting some pull requests with things you can fix whilst testing (-;

Thanks, Robert.

Leonardo Garberoglio

unread,
Oct 4, 2015, 2:33:23 PM10/4/15
to uavdevb...@googlegroups.com

Ok, I spend a few hours seeing video tutorials on YouTube about working with git. I think I understand now how it work.
A fork is a copy of a repository on my github account and is intended to work on a separate from original repo. I have to make changes an do a "pull request" when I finish my work. In the case of matrixpilot-nucleo it seems that this is not the better way to work, because there is nobody on matrixpilo/mitrixpilot waiting for may changes. Rigth?
So I have to "delete" my fork of matrixpilot.
Now,  Robert is leading mp-nucleo Branch and I want to collaborate with him.
So I have to clone their repo. Doing this I will have a copy of their code on my computer. And git clone add the remote, rigth? Next I have to change to nucleo branch with chekout.
At this point I can start to make my changes and do corresponding git add and git commit. When I want to upload my changes to Robert repo I have to do a git push. Before doing that I have to do a git pull to be sure I have the last code and maybe solve some conflicts. Is it right? So I don't have to work with forks on this case, right?

I will looking for some other tutorial on  YouTube.

BR, Leo

Leonardo Garberoglio

unread,
Oct 4, 2015, 8:03:49 PM10/4/15
to uavdevb...@googlegroups.com
Ok, right now I run
git -b MatrixPilot_nucleo --single-branch https://github.com/Inspirati/MatrixPilot.git MP_nucleo_git

and I have a copy of your work.
I will try to make some change and try tu push them (am I able to push to your github repo or I have to do a pull request?). I will work on STMSW-WS folder so there will be not conflicts with your work.

BR

Robert Dickenson

unread,
Oct 5, 2015, 8:29:39 AM10/5/15
to uavdevb...@googlegroups.com
Hi Leo,

Sounds about right to me (-:

Just earlier today I found myself experimenting with --single-branch! Shall say, i'm not fond of git so far...

I cannot see in github where i might me able to add you as a direct contributor, so short of changing to a shared password, lets try with the pull requests at first.

Thanks and regards, Robert.

Peter Hollands

unread,
Oct 5, 2015, 9:01:27 AM10/5/15
to uavdevb...@googlegroups.com
Robert,

Under https://github.com/inspirati/MatixPilot, you should be able click on Settings, and then Collaborators, and then add a name. (You will need to be logged in to see Settings)
This initially would let Leonardo push to your repository. He would initially need to enter his github account name and password on each push.

It is also possible to then setup secure shell keys so that he could then always push to your account with the need to put in a password.

Best wishes, Pete


Screen Shot 2015-10-05 at 13.57.17.png
Screen Shot 2015-10-05 at 13.57.34.png

Leonardo Garberoglio

unread,
Oct 21, 2015, 3:32:23 PM10/21/15
to uavdevb...@googlegroups.com
Can someone briefly explain me how to "merge" changes that robert made to their repository (and push to github) to my local copy?
I mean, I clone robert repo, I made changes to my local copy and robert push some changes to github. What is the easy way to check diferences and make a fusion of two group of files?

The other question is more basic. I have my local working copy and made some changes on file.c. I want to push changes to robert github repo. The steps are:
git add file.c
git checkout file.c
 and finally git push ..... and here what? I have just one branch (MatrixPilot_nucleo) of robert repo...

BTW I have git-scm and work on git-cmd (windows command line). I have windows 7 on my computer now so I can install some gui if it is needed.

thank!!!


Peter Hollands

unread,
Oct 22, 2015, 11:58:23 AM10/22/15
to uavdevb...@googlegroups.com
Hi Leoardo,

I think it is best to start with the command line, to get familiar with git concepts, and to stay aligned with most git tutorials.
Once you have things working, you can move onto using a GUI. Tom P. recently recommended Source Tree, which seems like a good tool. (I have it installed on my Mac and it will work on Windows).

I enclose a sample session below which I hope will be useful to show you how you can push your changes to your github account.
I have done this on my Mac, but it should be very similar for any command line  interface to git on any operating system.
(ls means list files and is DIR on windows.)

Best wishes, Pete

============================================================================

Peters-iMac:~ phollands$ mkdir leonardo

Peters-iMac:~ phollands$ cd leonardo

// Please Note I do not recommend cloning a single branch, but I know that is what you have done.

Peters-iMac:leonardo phollands$ git clone https://github.com/elgarbe/MatrixPilot --branch MatrixPilot_nucleo --single-branch

Cloning into 'MatrixPilot'...

remote: Counting objects: 12509, done.

remote: Compressing objects: 100% (742/742), done.

remote: Total 12509 (delta 2377), reused 1911 (delta 1911), pack-reused 9856

Receiving objects: 100% (12509/12509), 15.70 MiB | 1.44 MiB/s, done.

Resolving deltas: 100% (8970/8970), done.

Peters-iMac:leonardo phollands$ pwd

/Users/phollands/leonardo

Peters-iMac:leonardo phollands$ ls

MatrixPilot

Peters-iMac:leonardo phollands$ cd MatrixPilot

Peters-iMac:MatrixPilot phollands$ ls

Config MatrixPilot Tools libDCM libUDB

Doxyfile Microchip build-all.bat libFlashFS libVectorMatrix

FreeRTOS RollPitchYaw build-all.sh libLRS makefile

MAVLink STMSW-WS libCAN libSTM

Peters-iMac:MatrixPilot phollands$ echo  "testing" > readme.txt

Peters-iMac:MatrixPilot phollands$ git status

# On branch MatrixPilot_nucleo

# Untracked files:

#   (use "git add <file>..." to include in what will be committed)

#

# readme.txt

nothing added to commit but untracked files present (use "git add" to track)

Peters-iMac:MatrixPilot phollands$ git add readme.txt

Peters-iMac:MatrixPilot phollands$ git status

# On branch MatrixPilot_nucleo

# Changes to be committed:

#   (use "git reset HEAD <file>..." to unstage)

#

# new file:   readme.txt

#

Peters-iMac:MatrixPilot phollands$ git commit -m "Adding a test change for Leonardo so he can see how to use git"

[MatrixPilot_nucleo 586b0dc] Adding a test change for Leonardo so he can see how to use git

 1 file changed, 1 insertion(+)

 create mode 100644 readme.txt

Peters-iMac:MatrixPilot phollands$ git status

# On branch MatrixPilot_nucleo

# Your branch is ahead of 'origin/MatrixPilot_nucleo' by 1 commit.

#   (use "git push" to publish your local commits)

#

nothing to commit, working directory clean

Peters-iMac:MatrixPilot phollands$ git push origin MatrixPilot_nucleo

Username for 'https://github.com': ^C

// At this point I have had to interrupt the upload as I do not actually want to push this change to your repository,

// and because I can't as I do not know the password for your account.




Leonardo Garberoglio

unread,
Oct 22, 2015, 12:16:48 PM10/22/15
to uavdevb...@googlegroups.com
Peter, thank you very much!!!

I have one more question. I think that I read some were that between git add and git commit there will be a git checkout. Is that right?
One more, every time I change a file I have to do a git add? or it is for new files only?

once again, thank!

Peter Hollands

unread,
Oct 22, 2015, 1:19:50 PM10/22/15
to uavdevb...@googlegroups.com
Leonardo,

Normally you will clone the entire repository (with all the branches being cloned). In that case, you may want to switch from the default branch (which is usually master) to your branch.
So then you could switch from your current branch (probably "master") to your own branch with 

git checkout MatrixPilot_nucleo

That would switch your working code in your directory to "MatrixPIlot_nucleo" .

However you may want to to use "checkout" if you makes branches off of the MatrixPilot_nucleo branch. In other words you branch from your own branch. That is quite likely because
"Branches are cheap" is a saying in the github community. Making small branches for specific features is encouraged.
So most people make branches for each new feature, and then merge that back in.

And yes, you will need to "git add file" for each file that you want to be staged to your next "git commit".
This makes it easy to only include changes that are worth of a commit. For example, you may make changes to your options.h file, but not want those changes to be commited to the repository.
So the options.h file will not be in the commit because you do not "git add options.h". The GUI in source tree handles this concept more elegantly with check boxes to stage the files that you want.
In fact, source tree GUI will let you even just stage portions of a file for a commit. That can be handy.

Here is an another example session below these ideas in more detail ...

Best wishes, Pete

Peters-iMac:MatrixPilot phollands$ git status

# On branch MatrixPilot_nucleo

# Your branch is ahead of 'origin/MatrixPilot_nucleo' by 3 commits.

#   (use "git push" to publish your local commits)

#

nothing to commit, working directory clean

Peters-iMac:MatrixPilot phollands$ more readme.txt

testing

// Here I am going to make a new branch off of MatrixPilot_nucleo called test_branch

Peters-iMac:MatrixPilot phollands$ git checkout -b test_branch

Switched to a new branch 'test_branch'

Peters-iMac:MatrixPilot phollands$ more readme.txt

testing

Peters-iMac:MatrixPilot phollands$ date >> readme.txt

Peters-iMac:MatrixPilot phollands$ more readme.txt

testing

Thu 22 Oct 2015 18:00:08 BST

Peters-iMac:MatrixPilot phollands$ git status

# On branch test_branch

# Changes not staged for commit:

#   (use "git add <file>..." to update what will be committed)

#   (use "git checkout -- <file>..." to discard changes in working directory)

#

# modified:   readme.txt

#

no changes added to commit (use "git add" and/or "git commit -a")

Peters-iMac:MatrixPilot phollands$ git add readme.txt

Peters-iMac:MatrixPilot phollands$ git commit -m "another readme.txt change"

[test_branch a112c7c] another readme.txt change

 1 file changed, 1 insertion(+)

Peters-iMac:MatrixPilot phollands$ git status

# On branch test_branch

nothing to commit, working directory clean

//OK, now we will switch back to the main branch called MatrixPilot_nucleo

Peters-iMac:MatrixPilot phollands$ git checkout MatrixPilot_nucleo

Switched to branch 'MatrixPilot_nucleo'

Your branch is ahead of 'origin/MatrixPilot_nucleo' by 3 commits.

  (use "git push" to publish your local commits)

// Let's check that the readme.txt file does not have the date yet ...

Peters-iMac:MatrixPilot phollands$ more readme.txt

testing

// If we want the changes from pete_test put into MatrixPilot_nucleo we can merge ...

Peters-iMac:MatrixPilot phollands$ git merge test_branch

Updating 394d028..a112c7c

Fast-forward

 readme.txt | 1 +

 1 file changed, 1 insertion(+)

Peters-iMac:MatrixPilot phollands$ more readme.txt

testing

Thu 22 Oct 2015 18:00:08 BST

Peters-iMac:MatrixPilot phollands$ git status

# On branch MatrixPilot_nucleo

# Your branch is ahead of 'origin/MatrixPilot_nucleo' by 4 commits.

#   (use "git push" to publish your local commits)

#

nothing to commit, working directory clean

// Now we can push all the changes up to github again ...

Peters-iMac:MatrixPilot phollands$ git push origin MatixPilot_nucleo


// What is nice about making branches, is you can be working on 3 features separately, without worrying that they will effect each other ...

// git checkout -b faster_heartbeat

// git checkout -b variable_gyro_rates

// git checkout -b flaps_feature

// And then work on each feature set separately with multiple commits in each branch. As each feature become ready and tested, merge it back into MatrixPilot_nucelo 

Leonardo Garberoglio

unread,
Oct 22, 2015, 10:27:01 PM10/22/15
to uavdevb...@googlegroups.com

Peter, thank for your explanation, it was very useful!
I have one new question. I change my options.h and don't want to share, so don't add it. What happens if Robert make changes to their options.h and push to github? When I made a poll to obtain changes on the remote, what will happen with options.h?
Oh, one more. Let's say that I made a new branch, work a few days, make some commits, then I made another branch made some commits and finally merge all back to MP_nucleo and push to github. When Robert do a git poll what things git download? Will hi have a history with my intermediate work or just obtain what I push?

Thank

Leonardo Garberoglio

unread,
Oct 24, 2015, 10:04:39 PM10/24/15
to uavdevb...@googlegroups.com
Peter, I follow your advise. I make a new branch called test_RadioIn and star working on it. I made a commit right now. But I think there is a few more lines to check, and now I want to work on ServoOut. So I switch to MatrixPilo_Nucleo again and make a new branch, test_SO. I will work on this two braches until finish the work. Then I will merge to Matrixpilo_nucleo and push the changes to robert github repo.
is that allright?

best wish, leonardo

Peter Hollands

unread,
Oct 25, 2015, 3:18:58 AM10/25/15
to uavdevb...@googlegroups.com

Leonardo,

That sounds good and correct to me.

Best wishes Pete

Leonardo Garberoglio

unread,
Oct 25, 2015, 10:19:47 AM10/25/15
to uavdevb...@googlegroups.com

Pete, thank.

We want to try another approach. We want to o make use of pull request. To use that feature I have to fork Robert repo into my own github account, right?
Then I have to clone to my PC. I will made changes, branches, commits and when a feature is ready I have to push to my github and then do a pull request to Robert, right?
What is, in your opinion, best way to work.

Thank again

Best wishes, Leo

Peter Hollands

unread,
Oct 25, 2015, 5:05:28 PM10/25/15
to uavdevb...@googlegroups.com
Leonardo,

I can understand that you may want to use Pull requests instead of Push. So let's look at that scenario together in this post ...

I do not think you should fork Robert's repository on github. Neither do I think you should clone Robert's repository to your PC.

What you should do is:-
  • git remote add robert https://github.com/insprirati/MatrixPilot . This will tell git that there is a remote repository, which you are calling  "robert",  at https://github.com/inspirati/MatrixPilot
  • git fetch robert. This will make a copy of Robert's commits in a read-only branches such as  robert/MatrixPilot_nucleo on your PC.
  • git rebase robert/MatrixPilot_nucleo. That will rebase in time Robert's commits in front of your more recent commits in the timeline. That makes it much easier later on. You will both have Robert's
    commits first, and then your changes / commits' will be tacked on the end of the commit log in terms of a timeline.
  • Fix any conflicts. If there are conflicts that have been resolved, type "git rebase --continue" to finish off the rebase after the conflicts are resolved.
  • git push origin MatrixPilot_nucleo . To send your commits up to your account on github.
  • Create a pull request on github, for Robert to discuss and review your changes, or for him to press the button to merge your changes into his repository.
I am going to show a complete real terminal example below.

Best wishes, Pete

// I am going to re-clone a fresh repository just for this test.
// I happen to know that my repository is behind on commits' from Robert's repository. That is important for this test.
// I want to add some commits to my repository which is behind on Robert's. Then re-play Robert's new commits onto
// my repository so that my commits are moved to being after his commits. That uses the rebase command in git. 

NOTE: Leonardo, you would not need to re-clone your repository. I am just cloning for this test.
// Here goes ...

Peters-iMac:rebase_test phollands$ git clone https://github.com/phollands/MatrixPilot

Cloning into 'MatrixPilot'...

remote: Counting objects: 33014, done.

remote: Total 33014 (delta 0), reused 0 (delta 0), pack-reused 33014

Receiving objects: 100% (33014/33014), 42.70 MiB | 1.49 MiB/s, done.

Resolving deltas: 100% (24117/24117), done.

Peters-iMac:rebase_test phollands$ cd MatrixPilot/

Peters-iMac:MatrixPilot phollands$ git remote

origin

Peters-iMac:MatrixPilot phollands$ git remote add robert https://github.com/inspirati/MatrixPilot

Peters-iMac:MatrixPilot phollands$ git remote

origin

robert

Peters-iMac:MatrixPilot phollands$ git fetch robert

remote: Counting objects: 429, done.

remote: Compressing objects: 100% (18/18), done.

remote: Total 429 (delta 298), reused 293 (delta 293), pack-reused 118

Receiving objects: 100% (429/429), 240.24 KiB, done.

Resolving deltas: 100% (333/333), completed with 186 local objects.

From https://github.com/inspirati/MatrixPilot

 * [new branch]      MatrixPilotCameraChase -> robert/MatrixPilotCameraChase

 * [new branch]      MatrixPilotMulti -> robert/MatrixPilotMulti

 * [new branch]      MatrixPilot_3_x -> robert/MatrixPilot_3_x

 * [new branch]      MatrixPilot_4_0_balloon_launch -> robert/MatrixPilot_4_0_balloon_launch

 * [new branch]      MatrixPilot_4_1 -> robert/MatrixPilot_4_1

 * [new branch]      MatrixPilot_4_x -> robert/MatrixPilot_4_x

 * [new branch]      MatrixPilot_AUAV2 -> robert/MatrixPilot_AUAV2

 * [new branch]      MatrixPilot_AUAV3 -> robert/MatrixPilot_AUAV3

 * [new branch]      MatrixPilot_AUAV3_fixes -> robert/MatrixPilot_AUAV3_fixes

 * [new branch]      MatrixPilot_AccelerationCompensation -> robert/MatrixPilot_AccelerationCompensation

 * [new branch]      MatrixPilot_CAN -> robert/MatrixPilot_CAN

 * [new branch]      MatrixPilot_DB_Breeze -> robert/MatrixPilot_DB_Breeze

 * [new branch]      MatrixPilot_FreeRTOS -> robert/MatrixPilot_FreeRTOS

 * [new branch]      MatrixPilot_IP -> robert/MatrixPilot_IP

 * [new branch]      MatrixPilot_NASA_challenge -> robert/MatrixPilot_NASA_challenge

 * [new branch]      MatrixPilot_OS -> robert/MatrixPilot_OS

 * [new branch]      MatrixPilot_beta -> robert/MatrixPilot_beta

 * [new branch]      MatrixPilot_fbw -> robert/MatrixPilot_fbw

 * [new branch]      MatrixPilot_heli -> robert/MatrixPilot_heli

 * [new branch]      MatrixPilot_helicalTurns -> robert/MatrixPilot_helicalTurns

 * [new branch]      MatrixPilot_helicalTurns_BalloonLaunch -> robert/MatrixPilot_helicalTurns_BalloonLaunch

 * [new branch]      MatrixPilot_legacy -> robert/MatrixPilot_legacy

 * [new branch]      MatrixPilot_mw4 -> robert/MatrixPilot_mw4

 * [new branch]      MatrixPilot_mw4fbw -> robert/MatrixPilot_mw4fbw

 * [new branch]      MatrixPilot_nucleo -> robert/MatrixPilot_nucleo

 * [new branch]      MatrixPilot_sonar -> robert/MatrixPilot_sonar

 * [new branch]      MatrixPilot_vtol -> robert/MatrixPilot_vtol

 * [new branch]      MatrixPilot_wjp_helicalTurns -> robert/MatrixPilot_wjp_helicalTurns

 * [new branch]      Matrixpilot_on_Madre_board -> robert/Matrixpilot_on_Madre_board

 * [new branch]      master     -> robert/master

 * [new branch]      quad_testing -> robert/quad_testing

Peters-iMac:MatrixPilot phollands$ git checkout origin/MatrixPilot_nucleo

Note: checking out 'origin/MatrixPilot_nucleo'.


You are in 'detached HEAD' state. You can look around, make experimental

changes and commit them, and you can discard any commits you make in this

state without impacting any branches by performing another checkout.


If you want to create a new branch to retain commits you create, you may

do so (now or later) by using -b with the checkout command again. Example:


  git checkout -b new_branch_name


HEAD is now at 3f37f5a... MatrixPilot_nucleo: deprecate redef, move makefiles into tools directory.

// So now I have my own version of MatrixPilot_nucleo that I going to modify ...

Peters-iMac:MatrixPilot phollands$ date > readme.txt

Peters-iMac:MatrixPilot phollands$ git add readme.txt

Peters-iMac:MatrixPilot phollands$ git commit -m " A test commit"

[detached HEAD 312a583]  A test commit

 1 file changed, 1 insertion(+)

 create mode 100644 readme.txt

Peters-iMac:MatrixPilot phollands$ git log

commit 312a5836bb1a100738a65c73dd935e7e815daa25

Author: Peter Hollands <peter.h...@gmail.com>

Date:   Sun Oct 25 20:39:36 2015 +0000


     A test commit


commit 3f37f5ac8830f55c1c1c94eaae3e1263f42b187c

Author: Robert Dickenson <robert.d...@gmail.com>

Date:   Mon May 25 21:42:40 2015 +0000


    MatrixPilot_nucleo: deprecate redef, move makefiles into tools directory.

    

    git-svn-id: https://gentlenav.googlecode.com/svn/branches/MatrixPilot_nucleo@3644 cf4e4d4a-e611-11dd-8fb1-9960f2a117f8


Peters-iMac:MatrixPilot phollands$ git log robert/MatrixPilot_nucleo

commit c5dfabf587535a66078a43a268e3f191e384d141

Author: elgarbe <lgarbe...@gmail.com>

Date:   Sat Oct 24 00:33:18 2015 -0300


    Revert "Some changes to get freeRTOS tasks runing"

    

    This reverts commit 94e726bf03d0cb244aaf02ac3795eec9dfae80ab.




// Now we rebase the order of the commits, so Robert's commits from his repository will come before the test commit on my repository.

Peters-iMac:MatrixPilot phollands$ git rebase robert/MatrixPilot_nucleo

First, rewinding head to replay your work on top of it...

Applying:  A test commit

Peters-iMac:MatrixPilot phollands$ git log

commit 463a8d73ebe83e4ac677ebbbfcc085582b79fa89

Author: Peter Hollands <peter.h...@gmail.com>

Date:   Sun Oct 25 20:39:36 2015 +0000


     A test commit


commit c5dfabf587535a66078a43a268e3f191e384d141

Author: elgarbe <lgarbe...@gmail.com>

Date:   Sat Oct 24 00:33:18 2015 -0300


    Revert "Some changes to get freeRTOS tasks runing"

    

    This reverts commit 94e726bf03d0cb244aaf02ac3795eec9dfae80ab.


Peters-iMac:MatrixPilot phollands$ git push origin MatrixPilot_nucleo

Username for 'https://github.com': ^C

Peters-iMac:MatrixPilot phollands$ 

// Now once, the combined version is on my account, it will have first Robert's history of recent commits.

// This means my repository is effectively the same as his, but now just has some new commits tacked on the end.

// This will make it easy for Robert to review, when we create the Pull request to Robert.


// Note all of the above can also be done using the source tree GUI git tool. It is probably easier to use, and understand in the GUI that on the command line.

**** EXAMPLE ENDS ****

Robert Dickenson

unread,
Oct 25, 2015, 6:03:11 PM10/25/15
to uavdevb...@googlegroups.com
Thank-you Pete, excellent post. This git thing really is not straightforward eh..

Leonardo Garberoglio

unread,
Oct 25, 2015, 6:15:00 PM10/25/15
to uavdevb...@googlegroups.com
Peter, thank for your post! but I have to say I'm a litle lost.
I was reading this articles:

https://contribute.jquery.org/commits-and-pull-requests/
https://bocoup.com/weblog/git-workflows-for-successful-deployment
https://bocoup.com/weblog/git-workflow-walkthrough-feature-branches

https://help.github.com/articles/fork-a-repo/

I was thinking that I had understood how we had to work. but right now i'm lost. Lets take the first link, isn't that example aply to our job?

I will read agin and again you post to try to understand what you propose.

Thank you very much for your patience!



2015-10-25 19:03 GMT-03:00 Robert Dickenson <robert.d...@gmail.com>:
Thank-you Pete, excellent post. This git thing really is not straightforward eh..

Leonardo Garberoglio

unread,
Oct 25, 2015, 6:54:24 PM10/25/15
to uavdevb...@googlegroups.com
Peter, i think that you don't know how I been working until now, and so you suggest me your steps.
What I've done is:
1- I clone the matrixpilot_nucleo branch from Robert github repo. So I don't have MatrixPilot on my github account (in fact I have a fork of Matrixpilo/MatrixPilot, but never workd with it)
2- I workd on my local copy of robert repo. Robert gives me write acces to their repo.
3- I've made some commit and make 2 push to robert github repo
4- I revert last push becouse an error on a commit.
5- i create 2 branches on my local copy, made some changes, made some commits and that's all.I don't merge that branches to my master and dont' pull request and don't push that new changes.
Meantime robert workd on his local repo and don't push anithing to github. So all work was on robert github repo

So right now we think on the pull request aproach. I don't have problems to lost my recents commits. i don't have problem to delete all my local files and start over (there is a few changes i made and I have a paper printed version of them), but i want start on a correct and definitive way.
Taking that into acount, what do you suggest?

best wish, Leo

Peter Hollands

unread,
Oct 26, 2015, 7:01:37 AM10/26/15
to uavdevb...@googlegroups.com
Leonardo,

Yes, I had forgotten that you cloned your PC directly from Robert's github repository.
So your origin is actually Robert' github repository rather than your own.

This is how I see the model of how to collaborate with Robert.

Inline images 1
At the moment, because you cloned directly from Robert's github account to your PC (which is fine),
your own "origin" points at Robert's github repository, rather than your own github repository.
I would change to be inline with the diagram above. I expect that your "git remote -v" looks something like this:-

Peters-iMac:MatrixPilot phollands$ git remote -v

origin https://github.com/inspirati/MatrixPilot (fetch)

origin https://github.com/inspirati/MatrixPilot (push)

Peters-iMac:MatrixPilot phollands$ git remote rename origin robert

Peters-iMac:MatrixPilot phollands$ git remote -v

robert https://github.com/inspirati/MatrixPilot (fetch)

robert https://github.com/inspirati/MatrixPilot (push)

Peters-iMac:MatrixPilot phollands$ git remote add origin https://github.com/elgarbe/MatrixPilot

Peters-iMac:MatrixPilot phollands$ git remote -v

origin https://github.com/elgarbe/MatrixPilot (fetch)

origin https://github.com/elgarbe/MatrixPilot (push)

robert https://github.com/inspirati/MatrixPilot (fetch)

robert https://github.com/inspirati/MatrixPilot (push)

Peters-iMac:MatrixPilot phollands$ 

There is no need to reload any of your repositories, all throw away any of your branches. They should all just be fine.

When you push MatrixPilot_nucleo to your origin (your account on github), you may need to add "--force" to the command.
That is because the rebase command will have changed the history of commits, and the --force, will allow the push to change the history of commits on your github repository.
A normal push (when there has been no rebase), will simply be adding commits to an existing history on the github repository. But after a rebase of the repository on your PC,
you may have altered the history (probably), and so the --force command is required to tell git that you do mean to rewrite the history of commits on the github server.
git push origin --force MatrixPilot_nucleo 

Best wishes, Pete



Leonardo Garberoglio

unread,
Oct 26, 2015, 7:46:10 AM10/26/15
to uavdevb...@googlegroups.com
Peter, thank you!

Ok, I see your diagram and I understand that. I don't fully understand the rebase, but I will search the web looking for examples and usage to try to understand that part.
My MatrixPilot github repo is a fork of MatrixPilot/MatrixPilot. Is that ok?

every time I want to take robert's change of him github repo I have to do a fetch/rebase command?

Best wishes. Leo

Leonardo Garberoglio

unread,
Oct 26, 2015, 8:27:51 AM10/26/15
to uavdevb...@googlegroups.com

Robert Dickenson

unread,
Oct 27, 2015, 12:24:44 AM10/27/15
to uavdevb...@googlegroups.com
G'day Leo,

I recon each of those articles is relevant in its own way, just depends on what model we are trying to adopt!

Keep in mind both our github repo's are forks of MatrixPilot/MatrixPilot. At any time we can also post pull requests on our master repository, which is what we'll be doing once we get a decent STM32 build baseline.

Thank-you Peter for your excellent diagram. It really does help heaps for us to be able to visualise the situation.

I've still got to get my head around the rewriting history bit, however I do believe i can already see what that issue is addressing..


Mark Whitehorn

unread,
Nov 1, 2015, 10:19:30 AM11/1/15
to uavdevboard-dev

Robert Dickenson

unread,
Nov 1, 2015, 5:41:24 PM11/1/15
to uavdevb...@googlegroups.com
Thanks Mark, that pretty much sums it up so far (-;

Mark Whitehorn

unread,
Nov 1, 2015, 5:50:04 PM11/1/15
to uavdevb...@googlegroups.com
Seriously, I find rebasing to be one of the best features of git.

Tom Pittenger

unread,
Nov 1, 2015, 6:57:32 PM11/1/15
to uavdevb...@googlegroups.com

Rebase and rebase interactive are amazing

Reply all
Reply to author
Forward
0 new messages