2
6 13 2023 Cohort 2 Sync Notes
j edited this page 2023-06-14 02:49:37 +02:00
1700h: started
Max is reporting that he didn't do a git pull, did a commit, and had to create a merge commit as a result.
A typical workflow is:
- Repository checked out, possibly with upstream changes on GOGS,
- You have not made any commits since your last
git pull, - You have unstaged changes in your working copy.
If these conditions are met, the procedure is:
- Make sure you haven't made any commits using
git log, thengit pull. - If you receive an error message about an unclean tree, then do
git stash push. git pull- If you did
git stash pushearlier, now dogit stash pop. - Stage your changes (
git add), and commit them (git commit).
There's three places involved:
- The working copy, which is where you checked the repository out,
- The git stash, which is a temporary place for holding changes that haven't been staged or committed, and
- The git stage, which is where you put changes that you want to group into a commit.
The overall workflow is
working copy changes -> stash
upstream git server -> working copy
stash -> working copy
working copy changes -> stage
stage -> commit -> GOGS
1710h:
Reading notes review:
- Scott found that the
\_\_X\_\_()methods and attributes are called "dunder" methods and attributes, where dunder is a contraction of "double underscore". - Mentioned that the id() method returns a pointer.
- Mentioned that pass-by-reference and pass-by-value are two different ways of dealing with immutability. Python is mostly a pass-by-value system, so things like this won't change the caller's value:
>>> def f(a):
... a=2
...
>>> a=1
>>> a
1
>>> f(a)
>>> a
1
-
Mentioned that "fruitful" means "net gain" in terms of the resources spent making the optimization.
-
Mentioned the issue database for documenting getting stuck.
1735h: