TRANSFORM 2021
April 22 - 11am UTC
$ ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
curl -s http://metaphorpsum.com/paragraphs/N
curl -s http://metaphorpsum.com/sentences/N
curl -s http://metaphorpsum.com/paragraphs/N >> file1.txt
(base) ✔ ~/dev/t21
16:31 $ ls -l
total 0
drwxr-xr-x 2 stevejpurves staff 64 20 Apr 16:31 repo_one
(base) ✔ ~/dev/t21
16:32 $
git clone _______________
SSH or HTTP
git clone
ls -l
ls -la
ls -la .git
git branch
git checkout
git log
git log --graph --oneline --decorate --all
Q: Is there a benefit to using a desktop client? I get confused sometimes using the command line, but then I tried a client and it didn't help. Which one is best?
Q: What is the minimum I need to know to use git alone?
HEAD
0sjw3a
j3b4j2
d9jw7s
4j3n2h
9kwjcu
2ksjh7
js87sj
parent
fork
PR
Q: What is a fork?
Q: What is a pull request?
git config
git config --global --list
git config user.name Steve Purves
git config --global user.name Steve Purves
git init
git config user.name Steve Local
git config --list
Q: How to tell git to forget my repo?
git config --global alias.graph 'git log --graph --oneline --decorate --all'
git config --global --unset alias.graph
git branch -m master main
git add
git rm
git commit
git log
git log --graph --oneline --decorate --all
git diff
git show-refs
git tag
git branch
git merge
💥
Q: What is the minimum I need to know to use git alone?
git stash [push]
git stash pop
git stash list
---
git stash push -m "stash_name"
git stash pop stash@{n}
git stash apply stash@{n}
git stash branch <branchname> [stash@{n}]
git reset --hard HEAD
git reset --keep HEAD
git revert <commit>
// setup a branch with changes
git checkout -b branch2
// commit commit commit
git rebase main
git rebase main branch2
// do it again with conflicts
git rebase --onto <newparent> <start> <branch>
git commit --amend -m "my new message"
// you are rewriting history!
A GitHub repo is just a copy of your git repo on someone else's (Mircosoft's) computer
cd ..
mkdir repo_two
cd repo_two
git init --bare
cd ../repo_one
// make a change
git commit -am "changes"
git push ../repo_two
git remote add local ~dev/t21/repo_two
git remote add origin _____________
git push -u origin main
git checkout -b my-branch
git push
git tag 'v1.0.1'
git push --tags
sharing your repo in any way is publishing
pushing to a public repo on github / gitlab etc... is the most common
once you publish beware of `rewriting history`
git commit --amend -m "my corrected message"
git rebase main
git reset
git push --force-with-lease
original
fork
PR
PR
upstream
origin
Ideally:
What usually happens:
git clone git@github.com:euclidity/t21-lorem-ipsum.git
// make local changes
git commit
git push // !argh no permissions
// fork
git remote -v
git remote rename origin upstream
git remote add origin ___________________
git push -u origin master
git push -u origin main
// open PR
Q: Best practices for working on a project owned by someone else?
Q: Is git just for collaboration? Or should I be using it on my own projects too?
Q: When collaborating the check out, commit, merge etc... model makes sense. When working alone should we just commit as we go? Or be more structured?
Q: Why is main + branch_mr_X + branch_mr_y not good practice?
Q: What is a sensible policy when it comes to branches? How many should I be using?
Q: How to deal with others changing a file before you try to merge? (some mergers require too much time for a quick adjustment) Does git have a staging ground?
Q: When should I merge my work?
hot/issue-232 feat/new-shiny fix/things
google: component based development
dvc init
git status
git commit -am "init dvc"
dvc remote add mydrive gdrive://1uW00kcqk8VCRvBoYltmtQ7xq3EdIqPk4
dvc remote list
cp -r ../data .
dvc add data
git status
dvc push
git status
09:11 $ git status
On branch main
Your branch is ahead of 'origin/main' by 1 commit.
(use "git push" to publish your local commits)
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: .dvc/config
modified: .gitignore
new file: data.dvc
git commit -am "added dataset"
git push
a git commit linked to our data