Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Git'ing Started with Git

Git'ing Started with Git

Avatar for Scott Jungling

Scott Jungling

February 18, 2013
Tweet

More Decks by Scott Jungling

Other Decks in Programming

Transcript

  1. The Set-up • Bash Completion - Install it • Aliases

    - Get some and some more • Global .gitignore - Have one • SourceTree - Install It (Mac | Win)
  2. Clone the Parent Repository $ git clone --recursive \ https://github.

    com/buildcom/BuildStore Clone the SubModule Repository $ git submodule foreach --recursive \ git checkout master Cloning from GitHub
  3. Branching: Creating a new local $ git checkout -b IDS-5555

    • -b is the same as --branch • Branches should be the tracker IDs ◦ Example: IDS-5551 • Epic branches should have the epic- prefix on the branch name ◦ Example: epic-IDS-5552 ◦ Provides an integration point ◦ Easier for multiple devs to work on ◦ Easy to bundle up multiple trackers
  4. Branching: Submodules • If your tracker also requires changes to

    com, you’ll need to create a tracker branch • The com tracker branch should be named the same as the parent repo's branch $ cd com $ git checkout -b IDS-5555
  5. Branching: Checkout Remote $ git checkout -t origin/IDS-5555 • -t

    is the same as --track ◦ This creates the connection between your local branch titled IDS-5555 and the remote branch titled IDS-5555 on GitHub ◦ This makes git push & git pull work like magic.
  6. Save our current changes $ git stash save my-IDS-5555-wip $

    git fetch origin $ git checkout -b IDS-911 origin/master
  7. (mu)Stashin’ *Does Work* $ git add HOT_FIX_CHANGES $ git commit

    -m "IDS-911 fixin ur foo" $ git push -u origin IDS-911 *Open Pull Request on GitHub*
  8. Pushing to Github $ git push -u origin IDS-5555 •

    -u is the same as --set-upstream ◦ Similar to --track when creating branches from remotes ◦ Tells your local repository that your local IDS-5555 branch is connected to remote's IDS-5555 branch ◦ git pull & git push => moar magic.
  9. Time to Pull Request First, let’s make sure we’re current

    with the remote master branch with a quick rebase !!!Don't get burned by non-mergeable Pull Request!!!
  10. Rebasing Master $ git checkout master $ git pull \

    --recurse-submodules $ git checkout IDS-5555 $ git rebase master or without leaving your tracker branch $ git fetch origin $ git rebase origin/master
  11. Not to fear, citizen. Mergetool is here. 1. Fire up

    mergetool with: $ git mergetool 2. Resolve conflicts 3. Complete merge with: $ git commit Uh-oh… We’ve found a conflict
  12. Pull Requests • Navigate to your branch • Click Pull

    Request • Remember to include: ◦ The tracker ID in the title ◦ A short description of what's being changed.
  13. PR 2 QA 4 QC • Hand off the Pull

    Request to QA for Testing: • Fill out QA Request ◦ Recommend: Include the Pull Request URL in the Testing Instructions field Inspector Casey
  14. So… how do we deploy to sandbox? • Head over

    to https://bamboo.impdir.com/ • Select correct sandbox • Configure
  15. Making additional changes $ #squishBugs ==============> $ git add FILES_CHANGED

    $ git commit -m "IDS-5555 more fu" $ git push • Open Pull Requests will automatically pick- up new changes to the source branch. • You will need to re-send the tracker to QA through JIRA