Skip to content

Commit

Permalink
don't teach -a
Browse files Browse the repository at this point in the history
  • Loading branch information
Saransh-cpp committed Aug 14, 2024
1 parent 27071f6 commit aad87d1
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 34 deletions.
13 changes: 0 additions & 13 deletions ch00git/02Solo.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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)
6 changes: 4 additions & 2 deletions ch00git/03Mistakes.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
11 changes: 7 additions & 4 deletions ch00git/04Publishing.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
23 changes: 14 additions & 9 deletions ch00git/05Collaboration.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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}
Expand All @@ -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]
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions ch00git/10Branches.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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:
Expand Down
7 changes: 4 additions & 3 deletions ch00git/11Miscellany.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
3 changes: 2 additions & 1 deletion ch00git/12Remotes.ipynb.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit aad87d1

Please sign in to comment.