--
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.
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.
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
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.
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
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,
That sounds good and correct to me.
Best wishes Pete
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
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.
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!
Thank-you Pete, excellent post. This git thing really is not straightforward eh..
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$
Rebase and rebase interactive are amazing