Difference between revisions of "DPS909 & OSD600 Fall 2018"

From CDOT Wiki
Jump to: navigation, search
(Week 5)
Line 200: Line 200:
 
*** Conflict markers <code><<<<<<<<<</code>, <code>=============</code>, <code>>>>>>>>>>>>></code>
 
*** Conflict markers <code><<<<<<<<<</code>, <code>=============</code>, <code>>>>>>>>>>>>></code>
 
** [https://blog.humphd.org/fearless-merges/ Doing big merges in git]
 
** [https://blog.humphd.org/fearless-merges/ Doing big merges in git]
 +
 +
== Week 6 ==
 +
 +
* Hacktoberfest Updates
 +
** Add any interesting projects you find/work on to [https://github.com/humphd/hacktoberfest-at-seneca-2018/wiki/Interesting-Open-Source-Projects this list on the wiki]
 +
** Update your Info on the [https://github.com/humphd/hacktoberfest-at-seneca-2018/wiki/Student-Submissions submissions wiki page] by Monday:
 +
*** Add your Name beside your GitHub username
 +
*** New Pull Request
 +
*** New Blog Post
 +
*** Any Issues you're working on
 +
** [https://github.com/humphd/hacktoberfest-at-seneca-2018/blob/master/data/week01.md Week 1 Summary]
 +
 +
* <code>git rebase branch</code>
 +
** Replay commits on a new base branch/commit
 +
** Process goes like this:
 +
*** git finds a common ancestor commit of the branch you're on, and the one you're rebasing onto
 +
*** git calculates DIFFs for each, saves them to disk
 +
*** git checks out the commit you want to branch onto, and begins to replay those diffs one by one
 +
*** if there is a merge conflict, the rebase pauses so you can fix things
 +
*** use <code>git rebase --continue</code> or <code>git rebase --abort</code> to move forward after such a pause
 +
** Never rebase commits that are shared publicly in another repo.  Only do it on commits you own locally (e.g., a topic branch you are working on)
 +
** Don't use rebase to get rid of commits in a public branch, use <code>git revert commit-sha</code> instead to apply an inverse commit
 +
** If you rebase a branch you've pushed (e.g., for a pull request), when you push, use <code>git push origin branch-name -f</code> (f means force and will overwrite)
 +
** <code>git rebase -i</code> for interactive rebase
 +
*** shows a script of all commits in reverse order (order they will be replayed).  You can hand edit this to remove, re-order, or combine commits
 +
** You can squash on the same branch by rebasing on <code>HEAD~n</code> where n is how many commits back from HEAD to go
 +
 +
* PRs needing a Rebase
 +
** https://github.com/filerjs/filer/pull/496
 +
** https://github.com/filerjs/filer/pull/437
 +
** https://github.com/filerjs/filer/pull/439
 +
** https://github.com/filerjs/filer/pull/468
 +
** https://github.com/filerjs/filer/pull/545

Revision as of 15:25, 10 October 2018

Week 1

  • Course introduction

Week 2

  • Licenses
    • Rights, privileges, responsibilities, etc. applicable to someone other than the work's creator
    • "Terms and Conditions"
    • These must be granted by a copyright holder

Week 3

  • Consider Speaking and/or Attending the Free Software and Open Source Symposium (FSOSS).
  • Real world examples:
    • Filing, Fixing a bug in Filer
    • Adding a new Feature, Tests, and Docs to Filer - support node's new recursive fs.mkdir in Filer

Week 4

  • More Git
    • Git Walkthrough Part I
    • Git Walkthrough Part II
    • Some basic git commands you should make sure you know how to use:
      • git clone - clone an existing repository (i.e., one you've forked on GitHub)
      • git status - check what's happening with your repo, working directory, branch info
      • git add - add a file, files, or folder(s) of file(s)
      • git commit - commit changes in the staging area
      • git log - look back at existing commits
      • git diff - look at the difference between what's in the working directory and staging area, or between two commits
      • git rm - remove a file
      • git mv - move or rename a file
      • git reset - update the staging area, and perhaps working directory, with files from another commit (e.g., HEAD)
      • git checkout - switch to a branch or commit, or create, or get files from a branch/commit

Week 5

  • Merging with git
    • Where git branch splits histories apart, git merge brings them back together
    • Understanding DIFFs and Patch files
    • Types of Merges: Fast Forward, Recursive Merges are the most common
      • --ff-only to force a fast-forward (only the branch pointer is moved, no new commit is created)
      • 3-way merges: two branch commits with a common ancestor (new commit is created with multiple parents)
      • Can have any number of parents though: one of the larges is a 66 commit octopus merge in the Linux kernel
    • How to merge
      • start with a clean working directory
        • commit your work if you can; or
        • stash (git stash list, git stash show, git stash pop)
      • checkout the branch you want to merge into
      • git merge branch_to_merge_into_this_branch
    • Various flags and commands to know:
      • git merge --squash
      • git merge --abort
      • git merge --continue
      • git branch -d
    • Merge Conflicts
      • Conflict markers <<<<<<<<<, =============, >>>>>>>>>>>>
    • Doing big merges in git

Week 6

  • git rebase branch
    • Replay commits on a new base branch/commit
    • Process goes like this:
      • git finds a common ancestor commit of the branch you're on, and the one you're rebasing onto
      • git calculates DIFFs for each, saves them to disk
      • git checks out the commit you want to branch onto, and begins to replay those diffs one by one
      • if there is a merge conflict, the rebase pauses so you can fix things
      • use git rebase --continue or git rebase --abort to move forward after such a pause
    • Never rebase commits that are shared publicly in another repo. Only do it on commits you own locally (e.g., a topic branch you are working on)
    • Don't use rebase to get rid of commits in a public branch, use git revert commit-sha instead to apply an inverse commit
    • If you rebase a branch you've pushed (e.g., for a pull request), when you push, use git push origin branch-name -f (f means force and will overwrite)
    • git rebase -i for interactive rebase
      • shows a script of all commits in reverse order (order they will be replayed). You can hand edit this to remove, re-order, or combine commits
    • You can squash on the same branch by rebasing on HEAD~n where n is how many commits back from HEAD to go