ad: elecraft

Git clone and Eclipse - for a dummy

Discussion in 'Computers, Hardware, and Operating Systems' started by AA7EJ, Nov 3, 2019.

ad: L-HROutlet
ad: l-rl
ad: Subscribe
ad: MessiPaoloni-1
ad: Left-3
ad: L-MFJ
ad: Left-2
  1. AA7EJ

    AA7EJ Ham Member QRZ Page

    Whoops , I did it again...

    I decided to punish myself and add Bluetooth to popular NanoVNA "vector analyzer".

    I though I can just "git clone " the original (Open source ) code and go wild.

    Found several ways to "clone" the code to Eclipse IDE.


    Then I discovered that GitHub primary purpose is to share code with public.
    That's is OK by me, but...

    that is NOT what I want to do !
    for many reasons, unnecessary to divulge .

    So after configuring Eclipse for "git" I am stuck.
    It looks as I need to create local repository AND do git clone from GitHub repository.
    No problema.

    But I still do not know HOW to edit , compile and run it.
    What I am missing?

    I got "rebase" configured but do not know HOW to use it.
    Is that a right tool ?


    I'll be happy to just compile the code since to really test it will require downloading the "firmware" to the NanoVNA.

    I think emulating NanoVNA could be a nightmare.

    Here is one of the "git" tutorials for dummies like me.
    It does define "commit" buzzword everybody is using to confuse greenhorns likes me.


    https://dzone.com/articles/tutorial-git-with-eclipse
     
  2. WR2E

    WR2E Ham Member QRZ Page

    upload_2019-11-4_14-23-45.png
     
    W7UUU and KA9JLM like this.
  3. KA9JLM

    KA9JLM Ham Member QRZ Page

    Too bad that the ones that can help you are on your Ignore list.

    Good Luck. You may be on your own. But You can figure it out.
     
    K6CLS, W7UUU and WR2E like this.
  4. KT1F

    KT1F Ham Member QRZ Page

    Anyone can use GitHub repositories for any purpose but public repos are free so GitHub tends to be the most popular place for open source projects. They make money from the private repos which are not free.

    If this is the repo you mean https://github.com/ttrftech/NanoVNA, it has build instructions in the readme. It also has a Docker image which might be the easier way to go.
    That doesn't make sense. If you mean git rebase then that's not something you "configure". It's a git command.

    If you just want to edit the code for your own use and not contribute it back then you just need to clone the repo to your local machine and then start editing to do whatever you want with it. You don't really need to configure Eclipse for git. Git doesn't know or care what editor you use. I think Eclipse has some GUI help for git which might be what you mean but you don't really need that. I think it's best to learn the basic commands from the command line.

    The usual way if you're going to work on an open source project is to "fork" the repo to your own. Then clone your own repo to your local machine, create a new branch and work on that instead of master. Then when you're done, push to your repo and make a pull request.

    If you really don't want to show your code to the world, I guess you can just start working on master and don't push it anywhere.

    Getting back to rebase. If you create a new branch from master by doing something like:

    git checkout -b bluetooth.

    You'll now be working on a branch call bluetooth. Some time later, if master has changed because other people are working on the project then this ...

    git checkout master
    git pull
    git checkout bluetooth
    git rebase master

    will change your bluetooth branch to be as if it was branched now so it will get the recent changes. You might need to deal with merge conflicts if someone else has worked on the same area of the same file as you. Saying that you have "rebase configured" doesn't make sense unless you're using the word "rebase" to mean something else.

    You probably need to find a git tutorial. Git can be a bit daunting at first but all you probably need to know initially is clone, checkout, add, commit and maybe merge which are simple commands from the command line. If you truly just want to get the code and start working on it with no intention to contribute it back then I guess the only command you really need to know is git clone.
     
    Last edited: Nov 4, 2019
    KA9JLM likes this.
  5. AA7EJ

    AA7EJ Ham Member QRZ Page

    Thanks
    I did follow a "git for eclipse " tutorial and "rebase" was not too clear to me .
    I'll try to make a local repository and follow your comments.
    I just do not want to mess something in real , original github repository.

    I can do editing in my repository, but so far I have not figured out how to "build" - which is "standard" C way to run make.
    But if I am sure not to access github repository, I'll be OK to play with local copy of makefile then .

    I also have an issue with switching between command and IDE.
    It seems little backwards to use commands when most current IDE's are capable to work on project using GUI. But the documentation sucks. It always been an issue with Eclipse and 3rd party non-cooperation as far as documentation.

    But after your post I have a better understanding of basic git terminology. Thanks.

    I did manged to implement " Git perspective " (in Eclipse) which is equivalent to standard "C/C++ project" perspective.
    Now I have "Git repositories" (project) folder to work with.
    No more "project" but "Git repository".

    BTW
    the "readme.md" is all about using commands, which does not really help with Eclipse IDE.
    To be expected, obviously cannot be specific with so many IDE's.
    But I did try to follow it just for drill.
    Successfully started "make" but it did not completed due to some code expecting "C11" option in compiler .
    I did not want to mess with "makefile" so I switched to implementing github as GUI plug-in in Eclipse.
    I know how to option GCC in Eclipse , no problem there.


    PS
    Accessing "Docker" via original "readme.md" locked my Eclipse IDE.
    I'll try different way next.
     
  6. KT1F

    KT1F Ham Member QRZ Page

    You don't have to worry about accidentally causing damage to the original repository on GitHub. Even if you tried to push to it, you won't have permission to write so the command will fail. Only the owner or maintainer of the repository and anyone they give permission to can write directly to it. They way people contribute is to make a pull request which the maintainer can choose to accept and merge or not.

    I think the instructions are to literally just run the command "make".

    Well ... I still recommend learning a few basic git commands and forget about using a GUI for now. But again, if you just want to download the code and work on it for your own use, you can "git clone" and then forget about git. But ... you'd be better off learning few commands so you can make your own branch etc and do it in a more managed way.
     
  7. KA5IGI

    KA5IGI Ham Member QRZ Page

    I would recommend "Learn GIT in a Month of Lunches" from Manning. Manning always has specials and they can provide book, pdf and ebook formats with no drm. I prefer the hard copies for my "Reading Room". ;)
     
  8. AA7EJ

    AA7EJ Ham Member QRZ Page

    Nice, I'll try that.

    "Problem" with these tutorials they cover just the very basic and do only command line.

    However, from limited experience - these are "the steps" I have done, and almost every tutorial / book covers them
    1. install "git" - done and verified on my OS
    2. "git clone" using command - done
    3. run " make" - failed with error

    Now I am on my own to
    fix "make" error " - set GCC option to C11 - no longer a "git" issue - just "make"
    and continue my project

    Pretty simple and without using Eclipse GUI at all.



    Now the GUI IDE option - used two tutorials to complete , plain and with using SSH
    1. Add git plug-in into Eclipse - done and looks completed
    2. Configure Eclipse for "git" - user, e-mail ect. done and looks completed
    (BTW this configuration is same as my git and that is why I am concerned
    that I could accidentally screw-up the git repository - I am registered user !)
    3. Run Eclipse "git clone" - looks OK
    4. Activate "Git repository" perspective - done

    Now I am on my own to figure out HOW to run "Git repository" make - using Eclipse menus.
    So far no success and no tutorial how to.

    I could post the picture of the "Git repository" tree to illustrate what I have - in GUI _ so far.
    But it woudl make sense only if the discussion woudl cover Eclipse GUI , so far we have rehashed CLI.
    Not that there is a problem with that, it does help to get an idea about "git" in general.
    Unfortunately I am in "needing details" now.

    Thanks for all the support given, I appreciate it.

    73 Shirley



    Addendum
    Very brief look at the "lunch book" revealed YAGW - yet another git way - actually using Git GUI version. Maybe that is the answer if insist on complicating my life using GUI.
     
    Last edited: Nov 4, 2019
  9. KT1F

    KT1F Ham Member QRZ Page

    I hadn't seen that book before but it looks like it has 352 pages and 20 chapters.

    That's because git is a command line tool. Other people have built GUI shells for it. I think some are quite good. A lot of editors or IDEs have some sort of git integration. Obviously Eclipse is one. If you really want a GUI for Git, you might want to look into Source Tree https://www.sourcetreeapp.com I haven't used it but I know people who do and they're quite competent at the command line so it's probably good. I suggest something like Source Tree instead of a third party editor plugin but whatever ...

    Okay, that's good. If I'm understanding what you're trying to do, that's all you need from git right now. You next task is obviously to find out why make is failing. My guess is a missing dependency.

    That's because there is no such thing as "Git repository" make. Git is just a means of getting the files to your local machine and potentially managing them.

    None of your "how to build this project" problems are related to git. You have cloned the repository, make doesn't work. Messing with any git GUI is not going to help that.

    Happy to help :)

    As far as I know, there is no "Git GUI version". The book you've found is probably describing one of the many third party git GUI shells such as Source Tree or similar which may or may not be part of an editor.
     
  10. KA9JLM

    KA9JLM Ham Member QRZ Page

    Highly Recommended.

    upload_2019-11-4_16-45-45.jpeg
     

Share This Page