Cruisers Forum
 


Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 17-10-2014, 08:36   #1
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Git Questions

I'm rusty or have forgotten. I am trying to compile Sean's changes to the new Particle addon to Grib_pi.

What I did:
git remote add seanocpn git://github.com/seandepagnier/OpenCPN.git
. Downloads and then shows all of Sean's branches and there is a master.
. One of the branches is for the particle plugin
git remote -v shows
. origin git://github.com/OpenCPN/OpenCPN.git (fetch)
. origin git://github.com/OpenCPN/OpenCPN.git (push)
. seanocpn git://github.com/seandepagnier/OpenCPN.git (fetch)
. seanocpn git://github.com/seandepagnier/OpenCPN.git (push)

Now to compile do I do a git checkout seanocpn and then compile?
rgleason is offline   Reply With Quote
Old 17-10-2014, 09:20   #2
Registered User

Join Date: Jul 2010
Location: Hannover - Germany
Boat: Amel Sharki
Posts: 2,541
Re: Git Questions

There are easy to use graphical user interfaces for git available like e.g. SourceTree: https://www.atlassian.com/software/sourcetree/overview

So you can forget the command line interface to git.

Gerhard
CarCode is online now   Reply With Quote
Old 21-10-2014, 14:51   #3
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Git Questions

Gerhard, thanks. Have downloaded and used it and am getting used to it. Not sure I can do all I want to do with it yet, but will let you know...I still have a lot to learn.
rgleason is offline   Reply With Quote
Old 21-10-2014, 15:00   #4
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Git Questions

Now I realize that the author has made a pull request, I can just merge that pull request from the github notices emails by running
for example. That should be easy!

However I was setting up a remote branch and check it out this manner:
Code:
git remote add seanocpn git://github.com/seandepagnier/OpenCPN.git
Code:
git remote 
      .  origin      <-- the main opencpn repositiory
      .  seanocpn  <--sean's version repository
Code:
git remote -v
      . origin git://github.com/OpenCPN/OpenCPN.git (fetch)
      . origin git://github.com/OpenCPN/OpenCPN.git (push)
      . seanocpn git://github.com/seandepagnier/OpenCPN.git (fetch)
      . seanocpn git://github.com/seandepagnier/OpenCPN.git (push)
Code:
git remote show seanocpn
      .  shows all the branches on seanocpn including the master
Code:
git branch -a
      * master
      remotes/origin/HEAD --> origin/master
           --several other remote/origin branches
      remotes/seanocpn/master  (and others)
           --we want to set this as our branch now
So now how would I checkout the remote and be able to compile it?
Would I make a new branch like this?

Syntax:
Code:
git checkout --track -b  <local branch>       <remote>/<tracked branch>
For my case:
Code:
git checkout  --track -b   ocpn-sean    seanocpn/master
So I tried it.

Code:
C:\..\opencpn-git\build>git checkout --track -b ocpn-sean       seanocpn/master
      Branch ocpn-sean set up to track remote branch master from       seanocpn.
      Switched to a new branch 'ocpn-sean'

C:\..\opencpn-git\build>cd ..
      
C:\..\opencpn-git>git branch
        master
      * ocpn-sean
        origin
Next I went back to opencpn-git\build and ran cmake and it compiled!
Do you think it compiled sean's code?
rgleason is offline   Reply With Quote
Old 21-10-2014, 15:09   #5
Registered User
 
rgleason's Avatar

Join Date: Mar 2012
Location: Boston, MA
Boat: 1981 Bristol 32 Sloop
Posts: 17,632
Images: 2
Re: Git Questions

To update the local from the remote you can use the shortname this way, but first check the branch out once it has been created.

Code:
git checkout ocpn-sean
git fetch ocpn-sean

git checkout ocpn-sean
git pull
Keep in mind that:
1. Remote branch "seanocpn" = git://github.com/seandepagnier/OpenCPN.git
2. New (local) branch name is "ocpn-sean"

Here are some good links about remotes
Git Remotes: Fun Commands You Can Use | GitGuys - GitGuys
Adding and Removing Remote Branches - Git Branch - Giguys - GitGuys
"Tracking Branches" And "Remote-Tracking Branches" | GitGuys - GitGuys
Creating a Shared Repository; Users Sharing The Repository | GitGuys - GitGuys
The Configuration File - "Branch" Section | GitGuys - GitGuys
The Configuration File - "remote" Section - Git Config - GitGuys - GitGuys
Git Remote Branches - TunnelsUP
Git - Remote Branches
git - the simple guide - no deep ****! Simple Guide
rgleason is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Git build, problems with plugins (s63, climatology) jfburkhart OpenCPN 1 18-07-2014 23:49
Submitting code through GIT? JesperWe OpenCPN 4 14-04-2012 06:22
Git connection time out !! impossible to get last source code !! manuprenlair OpenCPN 5 18-12-2011 08:11
GIT Source Code Repository jallum OpenCPN 19 15-11-2011 05:22
git bdbcat OpenCPN 8 02-07-2010 09:32

Advertise Here


All times are GMT -7. The time now is 11:18.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.