how do i contribute?
TRANSCRIPT
How Do I Contribute?Tim Sutton
Concordia University, Montreal
IT Operations
IT OperationsDevelopment
Source Control Management (SCM)
Git
Git Mercurial
commit 922ae4e4d558cf5c47e8a815abf2f6fe7c25a409 Author: Graham Gilbert <[email protected]> Date: Mon Sep 1 15:03:34 2014 +0100
Symlink for backwards compatibility
diff --git a/Dockerfile b/Dockerfile index ee3529b..0f64d91 100644 --- a/Dockerfile +++ b/Dockerfile @@ -57,6 +57,7 @@ CMD ["/run.sh"]
EXPOSE 8000 VOLUME ["$APP_DIR/plugins", "$APP_DIR/sal/settings.py"] +RUN mkdir -p /home/app +RUN ln -s $APP_DIR /home/app/sal RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
commit 071822982716877cf37634df6b0ec5cb3754545d Author: Timothy Sutton <[email protected]> Date: Fri Oct 24 14:59:57 2014 -0400
Install Mavericks: bump to 10.9.5
diff --git a/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist b/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist index c656813..bef4c33 100755 --- a/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist +++ b/Workflows/559B48FA-A325-4E9C-A7D2-9AE0CCCD8195.plist @@ -17,7 +17,7 @@ <key>ignoreinstallfailure</key> <string>NO</string> <key>package</key> - <string>InstallOSX_10.9.4_13E28_custom_autobuild.pkg</string> + <string>InstallOSX_10.9.5_13F34_custom_autobuild.pkg</string> <key>postponedinstall</key> <string>NO</string> <key>targetname</key> @@ -31,6 +31,6 @@ </dict> </dict> <key>title</key> -<string> Upgrade to OS X Mavericks (10.9.4)</string> +<string> Upgrade to OS X Mavericks (10.9.5)</string> </dict> </plist>
Good housekeeping
Know where you are
Resources
2nd edition released mid-Octoberhttp://git-scm.com/book
https://github.com/progit/progit2
Resources
http://stackoverflow.com/questions/tagged/git?sort=votes
Resources
https://try.github.iohttp://onlywei.github.io/
explain-git-with-d3
Resources
https://try.github.iohttp://onlywei.github.io/
explain-git-with-d3
GUI
SourceTree
GitHub for MacGitX-dev
Tower
http://git-scm.com/download/gui/mac
SourceTree
GitHub for MacGitX-dev
Tower
Practice, practice
GitHub
GitHub
GitHub
GitHub
Contributor Maintainer
Contributor Maintainer
Submitting changes$
Submitting changes$
Submitting changes$ git clone https://github.com/timsutton/munki-conditions
Submitting changes$
Cloning into 'munki-conditions'...remote: Counting objects: 28, done.remote: Total 28 (delta 0), reused 0 (delta 0)Unpacking objects: 100% (28/28), done.Checking connectivity... done.
git clone https://github.com/timsutton/munki-conditions
$
Submitting changes
$
git:(master) >$
cd munki-conditions
Submitting changes
$
git:(master) >$
cd munki-conditions
Submitting changescp /new/munki/condition/virtual .
$
git:(master) >$
git:(master) ✗ >$
cd munki-conditions
Submitting changescp /new/munki/condition/virtual .
$
git:(master) >$
git:(master) ✗ >$ git status
cd munki-conditions
Submitting changescp /new/munki/condition/virtual .
$
git:(master) >$
git:(master) ✗ >$
On branch masterYour branch is up-to-date with 'origin/master'.Untracked files:
(use "git add <file>..." to include in what will be committed)
virtual
nothing added to commit but untracked files present (use "git add" totrack)
git status
cd munki-conditions
Submitting changescp /new/munki/condition/virtual .
git:(master) ✗ >$
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$ git checkout add-virtual
Switched to branch 'add-virtual'
git:(add-virtual) ✗ >$
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$ git checkout add-virtual
Switched to branch 'add-virtual'
git:(add-virtual) ✗ >$ git add virtual
git:(add-virtual) ✗ >$
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$ git checkout add-virtual
Switched to branch 'add-virtual'
git:(add-virtual) ✗ >$ git add virtual
git:(add-virtual) ✗ >$ git status
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$ git checkout add-virtual
Switched to branch 'add-virtual'
git:(add-virtual) ✗ >$ git add virtual
git:(add-virtual) ✗ >$ git status
On branch add-virtual Changes to be committed: (use "git reset HEAD <file>..." to unstage)
new file: virtual
git:(add-virtual) ✗ >$
Submitting changes
git:(master) ✗ >$ git branch add-virtual
git:(master) ✗ >$ git checkout add-virtual
Switched to branch 'add-virtual'
git:(add-virtual) ✗ >$ git add virtual
git:(add-virtual) ✗ >$ git status
On branch add-virtual Changes to be committed: (use "git reset HEAD <file>..." to unstage)
new file: virtual
git:(add-virtual) ✗ >$ git commit
Submitting changes
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #
Submitting changes
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #
Adding new ‘virtual’ condition
Submitting changes
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #
Adding new ‘virtual’ condition
- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion
Submitting changes
# Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # On branch add-virtual # Changes to be committed: # new file: virtual #
Adding new ‘virtual’ condition
- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion
:wq
Submitting changes
[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual
Submitting changes
[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual
git:(add-virtual) >$
Submitting changes
[add-virtual c633790] Adding new 'virtual' condition 1 file changed, 20 insertions(+) create mode 100755 virtual
git:(add-virtual) >$ git status
On branch add-virtual nothing to commit, working directory clean
Submitting changes
Submitting changes
Submitting changes
git:(add-virtual) >$
Submitting changes
git:(add-virtual) >$ git remote add mactech \
https://github.com/mactech2014/munki-conditions
git:(add-virtual) >$
Submitting changes
git:(add-virtual) >$ git remote add mactech \
https://github.com/mactech2014/munki-conditions
git:(add-virtual) >$ git push mactech add-virtual
Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 716 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To https://github.com/mactech2014/munki-conditions * [new branch] add-virtual -> add-virtual
Submitting changes
Submitting changes
Submitting changes
Submitting changes
Submitting changes
Pulling in changes git:(master) >$
Pulling in changes git:(master) >$
Pulling in changes git:(master) >$ git remote add mactech \
https://github.com/mactech2014/munki-conditions
git:(master) >$
Pulling in changes git:(master) >$ git remote add mactech \
https://github.com/mactech2014/munki-conditions
git:(master) >$ git fetch mactech
From https://github.com/mactech2014/munki-conditions * [new branch] add-virtual -> mactech/add-virtual * [new branch] master -> mactech/master
Pulling in changes git:(master) >$
Pulling in changes git:(master) >$ git log mactech/add-virtual
commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400
Adding new 'virtual' condition
- returns 'physical' on a physical Mac, 'vmware' on Fusion
commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400
Adding new 'virtual' condition
- returns 'physical' on a physical Mac, 'vmware' on Fusion
diff --git a/virtual b/virtual new file mode 100755 index 0000000..7697495 --- /dev/null +++ b/virtual @@ -0,0 +1,20 @@ +#!/bin/sh +# +# writes a condition: 'virtual', which can be:
Pulling in changes git:(master) >$ git log --patch mactech/add-virtual
index 0000000..7697495 --- /dev/null +++ b/virtual @@ -0,0 +1,20 @@ +#!/bin/sh +# +# writes a condition: 'virtual', which can be: +# - 'physical' if a physical machine +# - 'vmware' if a VMware VM +# +# Designed to be analogous to the 'virtual' Facter fact. No +# other virtualization platforms are supported currently. + +DEFAULTS=/usr/bin/defaults +MUNKI_DIR=$("${DEFAULTS}" read /Library/Preferences/ManagedInstalls ManagedInstallDir) +COND_DOMAIN="${MUNKI_DIR}/ConditionalItems" +KEY="virtual" + +VALUE="physical" +if system_profiler SPHardwareDataType | grep Boot\ ROM | grep VMW; then + VALUE="vmware" +fi + +"${DEFAULTS}" write "${COND_DOMAIN}" "${KEY}" "${VALUE}"
Pulling in changes
Pulling in changes git:(master) >$
Pulling in changes git:(master) >$ git merge mactech/add-virtual
Updating 34c2366..c633790 Fast-forward virtual | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 virtual
git:(master) >$
Pulling in changes git:(master) >$ git merge mactech/add-virtual
Updating 34c2366..c633790 Fast-forward virtual | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 virtual
git:(master) >$ git log -1
commit c633790b8405d30d2681ae6b912cf7d89dcad5bc Author: MacTech 2014 <[email protected]> Date: Thu Oct 23 14:50:08 2014 -0400
Adding new 'virtual' condition
- returns ‘physical’ on a physical Mac, ‘vmware’ on Fusion
Pulling in changes
Pulling in changes git:(master) >$
Pulling in changes git:(master) >$ git push
Counting objects: 3, done. Delta compression using up to 8 threads. Compressing objects: 100% (3/3), done. Writing objects: 100% (3/3), 716 bytes | 0 bytes/s, done. Total 3 (delta 1), reused 0 (delta 0) To https://github.com/timsutton/munki-conditions 34c2366..c633790 master -> master
git:(master) >$
Pulling in changes
Pulling in changes
Guidelines, ProTips
Just do it
CC BY 2.0 chan yiu hao
https://flic.kr/p/kiHuDG
Topic branches
Topic branches
Topic branches
http://stackoverflow.com/questions/1628563/move-the-most-recent-
commits-to-a-new-branch-with-git
Follow coding style
git status git diff --staged git diff --check
Referencing code on GitHub
Referencing code on GitHub
Referencing code on GitHub
https://help.github.com/articles/writing-on-github/https://help.github.com/articles/github-flavored-markdown/
https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py
Referencing code on GitHub
https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py#L93-L96
Referencing code on GitHub
https://github.com/autopkg/recipes/blob/mozilla-cdn-s3/Mozilla/MozillaURLProvider.py#L93-L96
Referencing code on GitHub
https://github.com/autopkg/recipes/blob/2a9594fcc660b812cd917e5c85698585eed04fed/Mozilla/MozillaURLProvider.py#L93-L96
Referencing code on GitHub
One-time pull
git pull <url> <branch>
One-time pull
git pull \ https://github.com/newspaperclub/osx-vm-templates \ easier-renaming-of-vagrant-user
Checking out pull requests$
Checking out pull requests
$
$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'
Checking out pull requests
$ git pull
$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'
Checking out pull requests
remote: Counting objects: 36, done.remote: Compressing objects: 100% (27/27), done.remote: Total 36 (delta 15), reused 19 (delta 9)Unpacking objects: 100% (36/36), done.From https://github.com/timsutton/osx-vm-templates* [new ref] refs/pull/1/head -> origin/pr/1* [new ref] refs/pull/16/head -> origin/pr/16* [new ref] refs/pull/2/head -> origin/pr/2* [new ref] refs/pull/3/head -> origin/pr/3* [new ref] refs/pull/4/head -> origin/pr/4* [new ref] refs/pull/6/head -> origin/pr/6* [new ref] refs/pull/8/head -> origin/pr/8
$ git pull
$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'
$
Checking out pull requests
remote: Counting objects: 36, done.remote: Compressing objects: 100% (27/27), done.remote: Total 36 (delta 15), reused 19 (delta 9)Unpacking objects: 100% (36/36), done.From https://github.com/timsutton/osx-vm-templates* [new ref] refs/pull/1/head -> origin/pr/1* [new ref] refs/pull/16/head -> origin/pr/16* [new ref] refs/pull/2/head -> origin/pr/2* [new ref] refs/pull/3/head -> origin/pr/3* [new ref] refs/pull/4/head -> origin/pr/4* [new ref] refs/pull/6/head -> origin/pr/6* [new ref] refs/pull/8/head -> origin/pr/8
$ git pull
$ git config --add remote.origin.fetch \'+refs/pull/*/head:refs/remotes/origin/pr/*'
$ git checkout origin/pr/16Note: checking out 'origin/pr/16'.
https://help.github.com/articles/checking-out-pull-requests-locally
http://git-scm.com/book/en/v2/GitHub-Maintaining-a-Project#Managing-Pull-Requests
http://nedbatchelder.com/blog/201407/fetching_github_pull_requests.html
Checking out pull requests
TextMate mode (press ’t’)
Always make a topic branch
Keep commits logical
TextMate mode (press ’t’)
Always make a topic branch
Keep commits logical
Shell integration
https://github.com/jimeh/git-aware-prompt
Shell integration
https://github.com/jimeh/git-aware-prompt
Oh-My-ZSH (default robbyrussel theme) http://ohmyz.sh
macops.ca/mactech-2014