Migrating to the New Git System - northern-bites/nbites GitHub Wiki

We're using a new system for using Git in 2016. The idea is to maintain the old system as a backup, in case we decide to revert back.

  1. Read the GitHub Flow page.

  2. Rename your current nbites directory to nbites-fork

  3. You will now clone the central nbites repository:

    git clone https://www.github.com/northern-bites/nbites.git nbites

    • if your ssh keys are in order, you may use this command instead git clone [email protected]:northern-bites/nbites.git nbites which will prevent you from needing to re-enter your username and password before pushing – or you can set that up later :)
  4. cd into the new nbites folder and setup the directory, starting at step 3 on the page Linux Setup. Yes, it is annoying, but necessary. This is a good time to test out the wiki - if you see any errors, announce it to everyone (because we are all using the wiki right now) and make the change.

  5. Go back into your now nbites-fork and figure out which of your current branches are under active development. Once you look at your local branches, you should also look at the branches on your fork of the GitHub repository (on GitHub) that may not be on your local machine. If you have branches that you feel should become feature branches, follow steps 6 - 8 for each branch.

  6. First, since you all have read the GitHub Flow page, you know the branch naming style that we are using for the Northern Bites. You now should rename your branch with a name that matches these naming styles (correct prefix, only using -'s, no camel case, all lowercase, no _ ). If you have questions, PLEASE ASK.

    git branch -m <oldname> <newname>

  • as an alternative solution, you can add your fork url as a remote in your clone repository. Now moving the branch to nbites is as easy (from the clone repository) as checking out the fork branch and pushing it to origin with -u new_correct_branch_name
  1. Now that you have a good branch name, you need to pull in develop. If you have not recently "remote-updated", then do so now. Since you're in the forked directory (nbites-fork), the main nbites repository here is remote under a name you have already chosen (probably northern-bites or nbites).

    git pull nbites develop

  2. After you have pulled in develop, you want to push to nbites. You should all have push access - let Megan know if you do not.

    git push nbites <correctly-formatted-branch-name>

    if you cannot push, and Git recommends using https instead you will have to change the remote URL by typing in the following into the terminal:

    git remote set-url origin [email protected]:northern-bites/nbites.git

  3. To start working on code, go back to your newly-created nbites folder (the cloned version), checkout your branch (git checkout -b <branch name> origin/<branch name>) from the main nbites repository. From this new nbites folder (cloned), the central nbites repository will be called origin!

  4. To create any new feature branches from this point on, (you should be in your newly-created nbites folder) and branch off of develop.

  5. Don't touch your nbites-fork directory until we are sure we are sticking with GitHub Flow.

  6. When you get your feature branches to a state where you want to merge them back in with develop, you'll need to submit a pull request. Stay tuned for a wiki page all about pull requests.

THE STATE OF THINGS NOW:

  • We have not yet updated master - have to run a scrimmage first to make sure it works.
  • Develop is up to date.
  • china-master and other branches floating around will be gone soon (or renamed to match correct naming) once we deal with them.
  • We are now using GitHub Flow!

IF YOU HAVE ANY QUESTIONS PLEASE ASK

⚠️ **GitHub.com Fallback** ⚠️