Hello Guest, if you are reading this it means you have not registered yet. Please take a second, Click here to register, and in a few simple steps you will be able to enjoy our community and use our OpenViX support section.
Results 1 to 8 of 8

Thread: Birdman's Git questiions/statements

  1. #1
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,769
    Thanks
    235
    Thanked 1,656 Times in 1,305 Posts

    Birdman's Git questiions/statements

    I don't suppose anyone has the info on doing this via the Web:


    • I forked enigma2 2 weeks ago, and have my own branch(es) in my copy.
    • I now want to update master and Dev in my fork to be the same as the OpenVix/enigma2 git, and to do so in a way that doesn't leave extraneous commits on my copy.


    Everything I've tried either resulted in a PR showing up in OpenVix/enigma2 git, or my copy having the update showing as a commit, which then messed up any further PRs I tried to create.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  2. #2
    abu baniaz's Avatar
    Title
    Moderator
    Join Date
    Sep 2010
    Location
    East London
    Posts
    23,338
    Thanks
    6,422
    Thanked 9,146 Times in 6,224 Posts

    GitHub Creating pull requests

    I could not find a way to sync once you commit to your copy of master or Dev branches.

    I will add the sourcetree guide for synchronization with the main project later.

    BTW, this is a locked thread, so don't expect replies from non moderators in this thread. I do this with all my guide threads to avoid spoils.

  3. The Following User Says Thank You to abu baniaz For This Useful Post:

    birdman (17-12-18)

  4. #3
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,769
    Thanks
    235
    Thanked 1,656 Times in 1,305 Posts
    Quote Originally Posted by abu baniaz View Post
    Point 1
    If you have already made changes to dev and master branches in your fork, save the changed files elsewhere.
    START AGAIN.
    Fork project
    Create new branch
    Re-add the changed files to your new branch of your fork (copy of project).
    That's the current state I am in.
    The problem is that once I've created my own fork there seems to be no way to update the dev and master branches (using the Web interface) to the latest state of the OpenVix master (which is what I may well need to do in order to create my next branch from Dev before submitting the next PR).
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  5. #4
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,769
    Thanks
    235
    Thanked 1,656 Times in 1,305 Posts
    Quote Originally Posted by birdman View Post
    Everything I've tried either resulted in a PR showing up in OpenVix/enigma2 git, or my copy having the update showing as a commit, which then messed up any further PRs I tried to create.
    Based on info gleaned from here (and twol?) I now have this script to keep my local copy up-to-date, and push that to my github forks.

    Code:
    #!/bin/sh
    #
    # Script to update my local repository from the remote masters, then push
    # that to my Web git copy.
    #
    # Assumes remote upstreams are added, e.g.:
    #  git remote add upstream https://github.com/OpenVIX/enigma2.git
    #
    # Also assume that:
    #    git config --global checkout.defaultRemote origin
    # has been run, to set the default checkout
    #
    
    if [ $# -eq 0 ]; then
        echo >&2 "Usage: git-updater.sh branch1 [branch2...]"
        echo >&2 "   (must be run inside the git repository)"
        exit 2
    fi
    
    for branch
    do
        echo "Updating $branch..."
        git checkout $branch
        git fetch upstream
        if [ "`git merge upstream/$branch`" = 'Already up-to-date.' ]; then
            echo 'Already up-to-date.'
        else
            git push origin $branch
            echo "...$branch updated"
        fi
    done
    Last edited by birdman; 21-10-19 at 16:43.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  6. #5
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,578
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    Quote Originally Posted by birdman View Post
    I don't suppose anyone has the info on doing this via the Web:


    • I forked enigma2 2 weeks ago, and have my own branch(es) in my copy.
    • I now want to update master and Dev in my fork to be the same as the OpenVix/enigma2 git, and to do so in a way that doesn't leave extraneous commits on my copy.


    Everything I've tried either resulted in a PR showing up in OpenVix/enigma2 git, or my copy having the update showing as a commit, which then messed up any further PRs I tried to create.
    What you are really asking is how not to have merge commits in your repo. Simple answer is not to make merge commits.

    If you want to keep your dev branch in sync with the official dev branch, do a pull rebase, not a pull merge.

    If you are working on a new feature, pull rebase ViX/dev into your/dev branch. Then add a new (feature) branch at the tip of your/dev branch.

    When you are done, push your/feature branch to github and make the PR using the web interface on github.

    Once the PR is accepted it will show in ViX/dev branch.

    To get it in your/dev branch pull rebase from ViX/dev branch.

    Never commit any of you own material to your/dev branch.

    ------------------------------------------------------------------

    In my own case, even though my fork is usually identical to ViX the commit history is very different. For me the only way out is cherry pick from my fork to OpenViX. This is because I didn't keep the dev branch clean of my own commits.
    Help keep OpenViX servers online.Please donate!

  7. #6
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,769
    Thanks
    235
    Thanked 1,656 Times in 1,305 Posts
    Quote Originally Posted by Huevos View Post
    What you are really asking is how not to have merge commits in your repo. Simple answer is not to make merge commits.
    The git fetch+push origin script in #7 seems to be working OK for me.
    I end up with master and Dev branches whose git logs contains the expected commits.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

  8. #7
    Huevos's Avatar
    Title
    Administrator
    Join Date
    Jun 2010
    Location
    38.5N, 0.5W
    Posts
    13,578
    Thanks
    2,004
    Thanked 4,925 Times in 3,259 Posts
    Ok, so you sidestepped it by not doing a "git pull" at all. So only your remote tracking branches are updated, not your local working copy.
    Help keep OpenViX servers online.Please donate!

  9. #8
    birdman's Avatar
    Title
    Moderator
    Join Date
    Sep 2014
    Location
    Hitchin, UK
    Posts
    7,769
    Thanks
    235
    Thanked 1,656 Times in 1,305 Posts
    Quote Originally Posted by Huevos View Post
    Ok, so you sidestepped it by not doing a "git pull" at all. So only your remote tracking branches are updated, not your local working copy.
    Quite possibly.

    My problem was how to keep my github Web (forked) copy and my local file-system copy (which is where all of the work is done) in-step.
    This achieves that.
    Then I only ever need to push my change-branches onto github, submit a PR and once that is dealt with (either way) I can delete my change-branch in both locations.
    MiracleBox Prem Twin HD - 2@DVB-T2 + Xtrend et8000 - 5(incl. 2 different USBs)@DVB-T2[terrestrial - UK Freeview HD, Sandy Heath] - LAN/USB-stick/HDD

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
This website uses cookies
We use cookies to store session information to facilitate remembering your login information, to allow you to save website preferences, to personalise content and ads, to provide social media features and to analyse our traffic. We also share information about your use of our site with our social media, advertising and analytics partners.