User:Cpeel/git bootcamp

From DPWiki
Jump to navigation Jump to search

cpeel is going to do a git "bootcamp" for interested parties as an introduction to using git. Developers already familiar with git are unlikely to find this overly useful.

Scheduling

There are two git bootcamps scheduled:

Folks are welcome to join whichever one they want.

Please plan on joining the meeting at least 15 minutes early to sort out any issues with the meeting tool itself.

Meeting mechanism

It looks like Google Hangouts is going to be the best free option to allow multiple people to have audio as well as screen sharing. This requires that you let me know what email address to send the Hangout invite to. You can either email me, or send me a PM with that information.

If you have other suggestions, please let me know.

Pre-requisites

Part of the training is going to have participants follow along with some of the steps, including making a branch, committing code, push the code back to SF, and submitting a merge request. To participate in this portion, participants should have some basic parts set up before the class starts.

In particular they need a working checkout of the DP code from Sourceforge. See DP Code Development Using git#Initial repository set up, followed by one of the two Workflow options. If you're using the DP Code Development VM, see the README.txt file in the VM for how to set up and configure a working git repository on the VM. While a fully-working test system is ideal, for the bootcamp you can do this on any computer that has git on it.

Please be sure you have this set up before the bootcamp. Ask in the Slack git-bootcamp channel if you have questions or problems getting this set up.

Agenda

This is a rough outline of what we'll be covering.

  • Source control basics
    • Centralized models (CVS, SVN) vs decentralized models (git)
    • Repositories & branches
  • Sourceforge and github
  • DP development model
    • TEST server, roll-outs to PROD, and code releases
  • git walk-through
    • creating a branch
    • committing code
    • pushing changes back to origin
    • submitting a merge request (aka: pull request)
    • switching branches
    • refreshing your repository from upstream
    • rebasing

Lab instructions

This lab assume you have a clone of your user git repository. They walk you through creating a branch, making changes in that branch, pushing those changes back to SourceForge, and creating a merge request.

git status
git branch <branch_name>
git checkout <branch_name>
git status
edit README.md to make some changes to it
git diff
git status
git add README.md
git commit
git status
git log
git push origin <branch_name>
Go to your SF user git repository
Click Request Merge
   Summary: <something>
   Source Branch: <branch_name>
   Target Branch: git-lab
   Description: <something>
Click Save