diff --git a/ch00git/02Solo.ipynb.py b/ch00git/02Solo.ipynb.py index ca5bfe30..3f04a89b 100644 --- a/ch00git/02Solo.ipynb.py +++ b/ch00git/02Solo.ipynb.py @@ -283,15 +283,6 @@ def wsd(code): # %% attributes={"classes": [" Bash"], "id": ""} jupyter={"outputs_hidden": false} # cat index.md -# %% [markdown] -# ### Commit with a built-in-add - -# %% jupyter={"outputs_hidden": false} language="bash" -# git commit -am "Change title" - -# %% [markdown] -# This last command, `git commit -a` automatically adds changes to all tracked files to the staging area, as part of the commit command. So, if you never want to just add changes to some tracked files but not others, you can just use this and forget about the staging area! - # %% [markdown] # ### Review of changes @@ -334,9 +325,5 @@ def wsd(code): C->I: Add content of index.md note right of C: git commit -m "Add a lie" I->R: Commit change to index.md - -note right of C: nano index.md -note right of C: git commit -am "Change title" -C->R: Add and commit change to index.md (and all tracked files) """ wsd(message) diff --git a/ch00git/03Mistakes.ipynb.py b/ch00git/03Mistakes.ipynb.py index 96db4842..d33fee0a 100644 --- a/ch00git/03Mistakes.ipynb.py +++ b/ch00git/03Mistakes.ipynb.py @@ -94,7 +94,8 @@ # git diff # %% jupyter={"outputs_hidden": false} language="bash" -# git commit -am "Add a silly spelling" +# git add index.md +# git commit -m "Add a silly spelling" # %% attributes={"classes": [" Bash"], "id": ""} jupyter={"outputs_hidden": false} language="bash" # git log --date=short @@ -166,7 +167,8 @@ note right of C: vim index.md -note right of C: git commit -am "Add another mistake" +note right of C: git add index.md +note right of C: git commit -m "Add another mistake" C->I: Add mistake I->R: Add mistake diff --git a/ch00git/04Publishing.ipynb.py b/ch00git/04Publishing.ipynb.py index 769f1436..8ec2fd72 100644 --- a/ch00git/04Publishing.ipynb.py +++ b/ch00git/04Publishing.ipynb.py @@ -125,7 +125,8 @@ # ### Git will not by default commit your new file # %% attributes={"classes": [" Bash"], "id": ""} jupyter={"outputs_hidden": false} magic_args="--no-raise-error" language="bash" -# git commit -am "Try to add Lakeland" +# git add lakeland.md +# git commit -m "Try to add Lakeland" # %% [markdown] # This didn't do anything, because we've not told git to track the new file yet. @@ -135,7 +136,7 @@ # %% attributes={"classes": [" Bash"], "id": ""} jupyter={"outputs_hidden": false} language="bash" # git add lakeland.md -# git commit -am "Add lakeland" +# git commit -m "Add lakeland" # %% [markdown] # Ok, now we have added the change about Cumbria to the file. Let's publish it to the origin repository. @@ -184,7 +185,8 @@ # Because we "staged" only index.md, the changes to lakeland.md were not included in that commit. # %% jupyter={"outputs_hidden": false} language="bash" -# git commit -am "Add Helvellyn" +# git add lakeland.md +# git commit -m "Add Helvellyn" # %% jupyter={"outputs_hidden": false} language="bash" # git log --oneline @@ -208,7 +210,8 @@ note right of C: git commit -m "Include lakes" I->R: Make a commit from currently staged changes: index.md only -note right of C: git commit -am "Add Helvellyn" +note right of C: git add lakeland.md +note right of C: git commit -m "Add Helvellyn" C->I: Stage *all remaining* changes, (lakeland.md) I->R: Make a commit from currently staged changes diff --git a/ch00git/05Collaboration.ipynb.py b/ch00git/05Collaboration.ipynb.py index 19c65e63..6e4c9881 100644 --- a/ch00git/05Collaboration.ipynb.py +++ b/ch00git/05Collaboration.ipynb.py @@ -190,7 +190,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Wales.md -# git commit -am "Translating from the Welsh" +# git commit -m "Translating from the Welsh" # %% jupyter={"outputs_hidden": false} language="bash" # git log --oneline @@ -209,7 +209,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Wales.md -# git commit -am "Add a beacon" +# git commit -m "Add a beacon" # %% jupyter={"outputs_hidden": false} language="bash" # git log --oneline @@ -259,10 +259,12 @@ note left of P: edit Scotland.md note right of C: edit Wales.md -note left of P: git commit -am "Add scotland" +git add Scotland.md +note left of P: git commit -m "Add scotland" P->PR: create commit with Scotland file -note right of C: git commit -am "Add wales" +git add Wales.md +note right of C: git commit -m "Add wales" C->CR: create commit with Wales file note left of P: git push @@ -300,7 +302,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Wales.md -# git commit -am "Add another Beacon" +# git commit -m "Add another Beacon" # git push # %% jupyter={"outputs_hidden": true} @@ -318,7 +320,7 @@ # %% jupyter={"outputs_hidden": false} magic_args="--no-raise-error" language="bash" # git add Wales.md -# git commit -am "Add Glyder" +# git commit -m "Add Glyder" # git push # %% [markdown] @@ -359,7 +361,8 @@ # Now commit the merged result: # %% jupyter={"outputs_hidden": false} language="bash" -# git commit -a --amend --no-edit # I added a No-edit for this non-interactive session. You can edit the commit if you like. +# git add Wales.md +# git commit -m "Resolve conflicts" # commit the resolved changes # %% jupyter={"outputs_hidden": false} language="bash" # git push @@ -390,10 +393,12 @@ note left of P: edit the same line in wales.md note right of C: edit the same line in wales.md -note left of P: git commit -am "update wales.md" +note left of P: git add Wales.md +note left of P: git commit -m "update wales.md" P->PR: add commit to local repo -note right of C: git commit -am "update wales.md" +note right of C: git add Wales.md +note right of C: git commit -m "update wales.md" C->CR: add commit to local repo note left of P: git push diff --git a/ch00git/10Branches.ipynb.py b/ch00git/10Branches.ipynb.py index 73fd0240..f0740ecf 100644 --- a/ch00git/10Branches.ipynb.py +++ b/ch00git/10Branches.ipynb.py @@ -48,7 +48,8 @@ * Cadair Idris # %% language="bash" -# git commit -am "Add Cadair Idris" +# git add Wales.md +# git commit -m "Add Cadair Idris" # %% attributes={"classes": [" Bash"], "id": ""} jupyter={"outputs_hidden": false} language="bash" # git switch main # Switch to an existing branch (use `checkout` if you are using git older than 2.23) @@ -140,7 +141,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Scotland.md -# git commit -am "Commit Aonach onto main branch" +# git commit -m "Commit Aonach onto main branch" # %% [markdown] # Then this notation is useful to show the content of what's on what branch: diff --git a/ch00git/11Miscellany.ipynb.py b/ch00git/11Miscellany.ipynb.py index f6470aa3..ccfc324e 100644 --- a/ch00git/11Miscellany.ipynb.py +++ b/ch00git/11Miscellany.ipynb.py @@ -73,7 +73,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Pennines.md -# git commit -am "Add Pennines" +# git commit -m "Add Pennines" # %% [markdown] # You can also use tag names in the place of commmit hashes, such as to list the history between particular commits: @@ -132,7 +132,7 @@ # %% jupyter={"outputs_hidden": false} language="bash" # git add Makefile # git add .gitignore -# git commit -am "Add a makefile and ignore generated files" +# git commit -m "Add a makefile and ignore generated files" # git push # %% [markdown] @@ -227,7 +227,8 @@ But has some tall hills, and maybe a mountain or two depending on your definition. # %% jupyter={"outputs_hidden": false} language="bash" -# git commit -am "Add github pages YAML frontmatter" +# git add index.md +# git commit -m "Add github pages YAML frontmatter" # %% [markdown] # ### The gh-pages branch diff --git a/ch00git/12Remotes.ipynb.py b/ch00git/12Remotes.ipynb.py index 58853db3..bca1ca24 100644 --- a/ch00git/12Remotes.ipynb.py +++ b/ch00git/12Remotes.ipynb.py @@ -55,7 +55,8 @@ * Whernside # %% jupyter={"outputs_hidden": false} language="bash" -# git commit -am "Add Whernside" +# git add Pennines.md +# git commit -m "Add Whernside" # %% jupyter={"outputs_hidden": false} language="bash" # git push -uf arc main