Changes

Jump to: navigation, search

DPS909 & OSD600 Winter 2019

3,637 bytes added, 14:32, 13 February 2019
Week 6
* [[DPS909/OSD600 Winter 2019 Lab 3|Lab 3]]
 
== Week 5 ==
 
* Finish Lab 3, [https://blog.humphd.org/browsing-open-source-projects/ Example: 3 projects I found recently]
** Also, see [https://docs.brew.sh/Linuxbrew Linuxbrew for Windows 10]
* [[OSD & DPS909 Winter 2019 Release 0.2|Release 0.2]]
** Lab 4 - first PR and Status update blog post (Friday Feb 15)
 
* Merging with git
** Where <code>git branch</code> splits histories apart, <code>git merge</code> brings them back together
** Understanding DIFFs and Patch files
*** <code>git diff</code>, <code>git show</code>, <code>git log -p</code>, etc. to show DIFFs
*** [https://github.com/filerjs/filer/pull/395 Pull Requests] also have links to get the raw [https://patch-diff.githubusercontent.com/raw/filerjs/filer/pull/395.diff .diff] and [https://patch-diff.githubusercontent.com/raw/filerjs/filer/pull/395.patch .patch]
*** [https://blog.humphd.org/vocamus-906/ How to read a DIFF file]
** Types of Merges: Fast Forward, Recursive Merges are the most common
*** <code>--ff-only</code> 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
**** <code>commit</code> your work if you can; or
**** <code>stash</code> (<code>git stash list</code>, <code>git stash show</code>, <code>git stash pop</code>)
*** checkout the branch you want to merge '''into'''
*** <code>git merge branch_to_merge_into_this_branch</code>
** Various flags and commands to know:
*** <code>git merge --squash</code>
*** <code>git merge --abort</code>
*** <code>git merge --continue</code>
*** <code>git branch -d</code>
** Merge Conflicts
*** Conflict markers <code><<<<<<<<<</code>, <code>=============</code>, <code>>>>>>>>>>>>></code>
** [https://blog.humphd.org/fearless-merges/ Doing big merges in git]
 
== Week 6 ==
 
* 0.2 Updates
** Interesting projects you've found?
** https://codetribute.mozilla.org/
** Update your Info on the 0.2 wiki with status blog post, PR(s)
 
* <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
*** use <code>git rebase --skip</code> to ignore the current commit and keep going
** 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
* <code>git cherry-pick SHA</code> to add a commit to the current branch

Navigation menu