Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update from original #1

Merged
merged 144 commits into from
Oct 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
144 commits
Select commit Hold shift + click to select a range
cdce2f5
Fix typos
Feb 19, 2019
f6a1b48
Merge pull request #175 from katrinleinweber/fix-typos
RandomSort Feb 21, 2019
a44aaf9
Remove usage of patch mode add from 3-way-merge exercise
JKrag Mar 16, 2019
950fd3c
Merge pull request #176 from praqma-training/170-remove-patch-mode
JKrag Mar 18, 2019
fe14a39
Add a bare minimum shell survival guide for training
JKrag Mar 20, 2019
73c89b3
Add more editor config options to basic-commits
JKrag Mar 21, 2019
b5c61c2
Fixed commit -m example
JKrag Mar 21, 2019
246e4b3
Remove --decorate from katas
JKrag Mar 23, 2019
fc4849b
Merge pull request #178 from praqma-training/remove-decorate
RandomSort Mar 25, 2019
9989a82
Mention `touch` to create an empty file
ftheile Apr 5, 2019
1119c7f
Update SHELL-BASICS.md
RandomSort Apr 5, 2019
93a767b
Merge pull request #179 from ftheile/patch-1
RandomSort Apr 5, 2019
11470d0
Fix a typo: append missing closing brace
ftheile Apr 16, 2019
2baefaa
Style: mark 'file.txt' as code
adamatan May 12, 2019
55d4be4
Fix typos
ntnhon May 21, 2019
cb578ea
Merge pull request #180 from ftheile/fix-typo
RandomSort May 31, 2019
590fc3f
Merge pull request #181 from adamatan/master
RandomSort May 31, 2019
70226d3
Merge pull request #182 from ntnhon/patch-1
RandomSort May 31, 2019
5161a41
Adding note about running sh in windows
sofusalbertsen Jul 1, 2019
34b461e
Mark "git status" as code
adamatan Jul 3, 2019
5559421
Merge pull request #184 from adamatan/markdown-fix
RandomSort Jul 4, 2019
2c965de
Add learning path to README
RandomSort Aug 5, 2019
ae5cd71
Merge pull request #189 from praqma-training/learning-path
RandomSort Aug 5, 2019
3d71a75
setup.sh and verify.sh should be executables
quartercastle Aug 7, 2019
3483d7d
Merge pull request #190 from kvartborg/make-setup-executable-in-bisec…
RandomSort Aug 7, 2019
c842cfc
Fixed numbering, so that it now increments both in shell and in markdown
grammeaway Aug 7, 2019
9e853b3
Merge pull request #191 from grammeaway/master
RandomSort Aug 12, 2019
ecf8776
Added atom and vscode to config examples
JKrag Aug 22, 2019
b4bc03c
Add simple way of setting up fake remote for exercises
JKrag Aug 27, 2019
b63f172
Change reorder-the-history exercise to use a remote
JKrag Aug 27, 2019
9b63379
Change fake remote script to create bare repo
JKrag Aug 27, 2019
5feeba2
Fixed a typo in reorder-the-history/README.md
atombrella Sep 8, 2019
b257ccd
Tweaked markdown in configure-git katas a bit.
atombrella Sep 17, 2019
edf1b33
Merge pull request #199 from atombrella/git_config_format
JKrag Sep 20, 2019
bf0be72
Merge pull request #194 from atombrella/grammar_fixes
JKrag Sep 20, 2019
aa5504a
Added .gitattributes to make line endings consistent.
atombrella Sep 9, 2019
168599d
Added more explanatory text to basic-commits/README
brent-clark-SED-Sw-Mgr Aug 26, 2019
301f919
Added exercise about excluding something from .gitignore
atombrella Sep 23, 2019
59d5e43
Introduction to github
Natasha2001 Sep 27, 2019
46c519b
Added exec-flag to setup.sh script, and fixed syntax error with shebang.
atombrella Oct 8, 2019
10df68a
Merge pull request #192 from praqma-training/improve-rebase-exercise
RandomSort Oct 9, 2019
10665da
Merge branch 'master' into git_attributes
RandomSort Oct 9, 2019
a5dbbc6
Merge pull request #193 from atombrella/git_attributes
RandomSort Oct 9, 2019
dfcb536
Merge pull request #196 from brent-clark-SED-Sw-Mgr/add-to-basic-comm…
RandomSort Oct 9, 2019
e231eef
Merge pull request #200 from atombrella/git_ignore_track_ignored
RandomSort Oct 9, 2019
03a672f
Merge pull request #202 from atombrella/rebase_source
RandomSort Oct 9, 2019
00a9e17
Merge pull request #201 from Natasha2001/master
RandomSort Oct 10, 2019
9e8ed9d
Set theme jekyll-theme-midnight
RandomSort Oct 11, 2019
0f430e6
Use makerepo function
alxb5 Oct 12, 2019
3b9e5ea
Added to Merge Mergesort README
brent-clark-SED-Sw-Mgr Aug 26, 2019
f56e566
Added useful commands section to amend/README.
brent-clark-SED-Sw-Mgr Aug 26, 2019
ee01d2c
Added to the task in reorder-the-history/README.
brent-clark-SED-Sw-Mgr Aug 27, 2019
8100f96
Add clone step to README Gif
alxb5 Oct 13, 2019
66f5b27
Added useful commands and more to reset/README
brent-clark-SED-Sw-Mgr Aug 27, 2019
2e29b3b
Added the task section to bad-commit/README.md
brent-clark-SED-Sw-Mgr Aug 28, 2019
ac8f6c2
Added The task to commit-on-wrong-branch/README.md
brent-clark-SED-Sw-Mgr Aug 28, 2019
e52649c
Added to The task in merge-conflict/README.md
brent-clark-SED-Sw-Mgr Aug 29, 2019
c9df4ca
Added to The task in reverted-merge/README.md
brent-clark-SED-Sw-Mgr Oct 14, 2019
1b921a4
Added The task in save-my-commit/README.md
brent-clark-SED-Sw-Mgr Oct 15, 2019
f94e033
Added to the task detached-head/README.
brent-clark-SED-Sw-Mgr Oct 19, 2019
5ccbc50
Changed "git" to "Git" in detached-head/README
brent-clark-SED-Sw-Mgr Oct 29, 2019
451a2b0
Update README.md
ftheile Oct 31, 2019
eb6c517
Added kata about git tags.
atombrella Sep 17, 2019
9313b5a
Improved squashing/README.md
brent-clark-SED-Sw-Mgr Oct 17, 2019
956ac8d
Removed reference to 'git rev-pars'
brent-clark-SED-Sw-Mgr Oct 30, 2019
1f9ead1
Minor improvements to submodules/README.md
brent-clark-SED-Sw-Mgr Oct 18, 2019
892d64f
Fix link in squashing-README
ftheile Nov 25, 2019
9669044
Simplify `git lol` alias
ftheile Nov 25, 2019
f805e2a
Added kata for .gitattributes
atombrella Sep 13, 2019
6ccb858
Mention `less` in SHELL-BASICS.md
ftheile Nov 27, 2019
e060df6
Word ordering
adamatan Dec 4, 2019
f8712d5
Add missing shebang in squashing/setup.sh
ftheile Dec 9, 2019
03298e1
fix: wording
Jan 24, 2020
1848caf
Reordered katas on Overiew and added missing ones
brent-clark-SED-Sw-Mgr Aug 29, 2019
dbfccc8
Added pointer to Overview also as Learning Path
brent-clark-SED-Sw-Mgr Jan 1, 2020
1ef8902
Use explicit numbering
RandomSort Feb 10, 2020
1e07423
Expand on submodules kata
Nov 25, 2019
262c478
Fix three typos
RandomSort Dec 5, 2019
032a8fc
Fix typos in submodule README
RandomSort Feb 10, 2020
c1514f2
Add kata Rebase Interactive with autosquash
alxb5 Oct 19, 2019
335e019
Clean up unused trainer-notes.md
RandomSort Feb 13, 2020
fbb5185
Update README.md
ftheile Mar 23, 2020
e3aab3e
Updating git cheatsheet
schiluveri Apr 2, 2020
574ee38
clarified pull-request comments
schiluveri Apr 2, 2020
f7d084a
correction to wrong description of 'git reset'
schiluveri Apr 6, 2020
c85f03b
clearing the description to be precise
schiluveri Apr 8, 2020
eb81702
changed how shell script could be sourced in katas
schiluveri Apr 9, 2020
ee47b7d
Merge pull request #234 from praqma-training/git-katas-issue-146
JKrag Apr 9, 2020
17ebe6a
Set local git user name and email after initializing exercise repo (t…
schiluveri Apr 1, 2020
4e4039a
updating a email address to look like one.
schiluveri Apr 2, 2020
e2166a9
chaning email address to suggested
schiluveri Apr 6, 2020
8c48cc7
helper functions to set and unset local user for training bot commits…
schiluveri Apr 8, 2020
bba8d07
Merge pull request #235 from praqma-training/git-katas-issue-59
JKrag Apr 15, 2020
de28d2b
unset error option at the end
schiluveri Apr 16, 2020
da71cd7
Merge pull request #236 from praqma-training/git-katas-unset-e
sofusalbertsen Apr 16, 2020
01528b6
advanced-rebase-interactive README: be consistent with cmdline args
ftheile Apr 22, 2020
50cea38
configure-git README.md: mention private SSH key file
ftheile Apr 23, 2020
afecd63
Simplify basic revert
RandomSort Apr 29, 2020
2f70997
Elaborate and bugfix on rebase-exec
RandomSort Apr 29, 2020
df4f747
use local remote for prepush kata
May 6, 2020
d7fe47b
Elaborate save my commit
May 6, 2020
74f9431
Small typos in ignore kata README
May 6, 2020
2208f3f
Add master based workflow kata
May 13, 2020
b8c4220
Fix wording in new exercise description
JKrag May 13, 2020
e495745
Add fake author in master-based-workflow exercise
ftheile May 14, 2020
80e6b2e
Fleshed out section one of config-git.md
sofusalbertsen May 25, 2020
40c98ab
Fixed language and content for config-git
sofusalbertsen May 25, 2020
3050dcc
Consistently use dashes in utils function names
May 13, 2020
e6b607b
Add +x rights to pre-push setup.sh
May 13, 2020
8e32a28
[Master Workflow] Fix Autor typo
RandomSort Jun 3, 2020
faa1282
Consistently write 'Git' if talking about the tool
ftheile Jun 2, 2020
2905cdb
First try to rework "Configure Git" kata
ftheile Jun 2, 2020
f5e0af5
Prevent weird errors when running setup.sh using e.g. bash setup-sh i…
Jun 11, 2020
0c5870e
Fix setup scripts of `submodule` kata
ftheile Jun 8, 2020
393c79d
Create GitHub actions CI pipeline for running test scripts (#265)
bothzoli Jul 1, 2020
3054846
Create setup and verify scripts for bisect kata
Jun 10, 2020
0d4aca4
Create setup script for merge-driver kata
Jun 10, 2020
a7e3980
Add file ending new lines
Jun 10, 2020
081b82c
Add setup.ps1 for git-attributes kata
Jun 12, 2020
c42c13b
Add setup.ps1 for git-tag kata
Jun 12, 2020
82d1f0c
Add setup.ps1 for master-based-workflow kata
Jun 12, 2020
d659960
Update README.md for git-attributes and git-tag
Jun 12, 2020
842eef4
Add setup.ps1 for pre-push kata
Jun 12, 2020
51d8dd3
Add setup.ps1 and verify.ps1 for rebase-exec kata
Jun 12, 2020
c70be83
Update README.md for bisect and merge-driver
Jun 12, 2020
b44b2c9
Gracefully fail when removing exercises folder
bothzoli Jun 9, 2020
98d531e
Further improve error handling in setup.ps1
bothzoli Jun 10, 2020
5321a48
FIX problem that kills shell if not bash (#268)
sofusalbertsen Aug 5, 2020
ceb99e7
adding Dockerfile with zsh for regression test
sofusalbertsen Aug 5, 2020
37d3650
Complete zsh test
sofusalbertsen Aug 5, 2020
ad2bf25
Fix errors in actions CI file
sofusalbertsen Aug 5, 2020
78fc4d1
added explanatory text to ffmerge README
Aug 5, 2020
58ea1c2
Update README.md
joachimbulow Aug 5, 2020
74b71e0
Disable GPG signing of commits locally during setup
Sep 8, 2020
face7c1
Add VS Code as a suggested editor
Sep 8, 2020
b05ba04
Create change author kata
bothzoli Jul 2, 2020
1d3fdd6
Fix PR review findings
bothzoli Sep 5, 2020
fe76b80
Add commands that show contents of commits to better illustrate amend…
EfiGaja Sep 11, 2020
122f4cf
Add an explanation for commands to run with amend.
EfiGaja Sep 11, 2020
cc38a4a
Final proposal for subtree git-katas
bicschneider Apr 16, 2020
b17be5e
Add publish workflow
Sep 25, 2020
4e19fc0
Change archive publising to a GH Release
Sep 25, 2020
fbd782d
Fix indentation issue in publish.yml
Sep 25, 2020
8e82726
Fix tag in release asset name
Sep 25, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto eol=lf
8 changes: 8 additions & 0 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
FROM ubuntu:latest
RUN apt update -y
RUN apt install zsh git -y
COPY . /tmp/git-katas
WORKDIR /tmp/git-katas
ENV SHELL /bin/zsh
ENTRYPOINT [ "zsh" ,"-c" ]
CMD ["source testzsh.sh"]
42 changes: 42 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Publish

on:
push:
tags:
- '*'

jobs:
publish:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Get tag
id: get_tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\//}

- name: Archive katas
shell: bash
run: git archive --output=git-katas.zip HEAD

- name: Create GitHub release
id: create_release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ github.ref }}
release_name: Release ${{ github.ref }}
draft: false
prerelease: false

- name: Attach katas
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ./git-katas.zip
asset_name: git-katas-${{ steps.get_tag.outputs.TAG }}.zip
asset_content_type: application/zip
53 changes: 53 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: CI

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
setup-bash:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run bash test scripts
shell: bash
run: |
chmod +x ./test.sh
./test.sh

setup-bash-macos:
runs-on: macos-latest

steps:
- uses: actions/checkout@v2

- name: Run bash test scripts
shell: bash
run: |
chmod +x ./test.sh
./test.sh

setup-pwsh:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Run PowerShell Core test scripts
run: ./test.ps1
shell: pwsh

setup-zsh:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2

- name: Build Zsh image
run: docker build -t zshell -f .github/Dockerfile .
- name: running zsh test
run: docker run zshell
8 changes: 5 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
*~
*.swp
**/exercise
git_attributes
*~
*.swp
**/exercise
**/remote
23 changes: 10 additions & 13 deletions 3-way-merge/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,21 @@

## Setup

1. Run `. setup.sh` (or `.\setup.ps1` in PowerShell)
1. Run `source setup.sh` (or `.\setup.ps1` in PowerShell)

## The task
You again live in your own branch, this time we will be doing a bit of juggling with branches, to show how lightweight branches are in git.

1. Create a branch called greeting and check it out
1. Edit the greeting.txt to contain your favorite greeting
1. Add greeting.txt files to staging area using patch mode (`-p`)
1. Commit
1. Switch back to the master branch
1. Create a file README.md with information about this repository
1. Try adding README.md file to staging area using patch mode (it wont work)
1. What is the output of `git status`?
1. Add the README.md file to staging area and make the commit
1. What is the output of `git log --oneline --graph --all`?
1. Diff the branches
1. Merge the greeting branch into master
2. Edit the greeting.txt to contain your favorite greeting
3. Add greeting.txt files to the staging area
4. Commit
5. Switch back to the master branch
6. Create a file README.md with information about this repository
7. Add the README.md file to staging area and make the commit
8. What is the output of `git log --oneline --graph --all`?
9. Diff the branches
10. Merge the greeting branch into master

## Useful commands
- `git branch`
Expand All @@ -28,7 +26,6 @@ You again live in your own branch, this time we will be doing a bit of juggling
- `git checkout -b <branch-name>`
- `git branch -v`
- `git add`
- `git add -p`
- `git commit`
- `git commit -m`
- `git merge <branchA> <branchB>`
Expand Down
2 changes: 1 addition & 1 deletion 3-way-merge/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
source ../utils/utils.sh

kata="3-way-merge"
makerepo
make-exercise-repo

touch greeting.txt
git add greeting.txt
Expand Down
119 changes: 46 additions & 73 deletions Overview.md
Original file line number Diff line number Diff line change
@@ -1,73 +1,46 @@
# Overview of Git Katas


## [Bad-commit](bad-commit/README.md)
Cleaning up a bit.

## [basic-commits](basic-commits/README.md)
Very basic creation of commits.

## [basic-staging](basic-staging/README.md)
interacting with the stage (index).

## [basic-branching](basic-branching/README.md)
The first stride into branching.

## [basic-cleaning](basic-cleaning/README.md)
Cleaning the workspace.

## [ignore](ignore/README.md)
The basics of using the `.gitignore` file.

## [commit-on-wrong-branch](commit-on-wrong-branch/README.md)
An administrative exercise, how do we _move_ a commit that we accidentially put on the wrong branch.

## [commit-on-wrong-branch-2](commit-on-wrong-branch-2/README.md)
Another exercise on what to do if you have accidentially committed
on the wrong branch.

## [ff-merge](ff-merge/README.md)
A tour around the most trivial of merges.

## [3-way-merge](3-way-merge/README.md)
A basic merge, involving multiple diverged branches.

## [merge-conflict](merge-conflict/README.md)
A basic merge between diverging branches with incompatible changesets.

## [merge-mergesort](merge-mergesort/README.md)
A merge confligt with actual code.

## [reverted-merge](reverted-merge/README.md)
A merge has to be reverted, but this causes problems.

## [rebase-branch](rebase-branch/README.md)
Using rebase as an alternative to merging.

## [pre-push](pre-push/README.md)
A quick exercise in using Git hooks.

## [reorder-the-history](reorder-the-history/README.md)
We might have created our commits in a suboptimal order, practice to fix that scenario here.

## [reset](reset/README.md)
Reset is a powerful and slightly dangerous command if you do not know what you are doing.
Go trough the three modes of resetting here.

## [basic-stashing](basic-stashing/README.md)
The first stride into stashing.

## [save-my-commit](save-my-commit/README.md)
Should you accidentially or on purpose delete a commit, go here to try and save it.

## [squashing](squashing/README.md)
A lot of small commits is good when you are working locally, but for sharing your code, it might be more beneficial to deliver your code changes in large sets. Go here to experiment with that.

## [submodules](submodules/README.md)
Submodules are loathed by many. Run through this exercise to see what the ruckus is all about.

## [Investigation](investigation/README.md)
Discover what is going on in a Git repo, figure out what it looks like under the hood.

## [Objects](objects/README.md)
A small exercise into Git internals.
# Overview of the Git Kata Exercises

## Setup

1. [configure-git](configure-git/README.md) - If git is not configured, some basic configuration steps

## Basic Git Katas in Suggested Order

1. [basic-commits](basic-commits/README.md) - Very basic creation of commits.
2. [basic-staging](basic-staging/README.md) - Interacting with the stage (index).
3. [basic-branching](basic-branching/README.md) - The first stride into branching.
4. [ff-merge](ff-merge/README.md) - A tour around the most trivial of merges.
5. [3-way-merge](3-way-merge/README.md) - A basic merge, involving multiple diverged branches.
6. [merge-conflict](merge-conflict/README.md) - A basic merge between diverging branches with incompatible (but simple) changesets.
7. [merge-mergesort](merge-mergesort/README.md) - A merge conflict with actual code.
8. [rebase-branch](rebase-branch/README.md) - Using rebase as an alternative to merging.
9. [basic-revert](basic-revert/README.md) - Use revert to revert a change
10. [reset](reset/README.md) - Reset is a powerful and slightly dangerous command if you do not know what you are doing. Go through the three modes of resetting here.
11. [basic-cleaning](basic-cleaning/README.md) - Cleaning the workspace.
12. [amend](amend/README.md) - Amending previous commits.
13. [reorder-the-history](reorder-the-history/README.md) - We might have created our commits in a suboptimal order, practice to fix that scenario here.
14. [squashing](squashing/README.md) - A lot of small commits is good when you are working locally, but for sharing your code, it might be more beneficial to deliver your code changes in large sets. Go here to experiment with that. Write a good commit
15. [advanced-rebase-interactive](advanced-rebase-interactive/README.md) - Practice using the interactive rebase commands.
16. [basic-stashing](basic-stashing/README.md) - The first stride into stashing.
17. [ignore](ignore/README.md) - The basics of using the `.gitignore` file. And using `git rm`.
18. [submodules](submodules/README.md) - Submodules are loathed by many. Run through this exercise to see what the ruckus is all about.
19. [git-tag](git-tag//README.md) - Tags are convenient for keeping track of commits that bump a version number. In this exercise, you will list, add and delete tags.

## Katas that solve standard problems

1. [commit-on-wrong-branch](commit-on-wrong-branch/README.md) - If we accidentally put unpushed commits on the wrong branch, how do we effectively _move_ them to another branch before our work on that branch.
2. [commit-on-wrong-branch-2](commit-on-wrong-branch-2/README.md) - Another exercise on what to do if you have accidentally committed on the wrong branch.
3. [reverted-merge](reverted-merge/README.md) - We revert a merge, but, after fixes are added to the merged branch, we want the changes from merge and the new fixes.
4. [save-my-commit](save-my-commit/README.md) - Should you accidentally or on purpose delete a commit, go here to try and save it. You will use the reflog.
5. [detached-head](detached-head/README.md) - git complains that you are in a "You are in 'detached HEAD' state". What do you do?

## Katas On Advanced features

1. [git-attributes](git-attributes/README.md) - .gitattributes file allows you to specify how git handles files, such as line endings in text files or how to diff a binary file.
2. [Bad-commit](bad-commit/README.md) - Using `git bisect` to find a bad commit.
3. [bisect](bisect/README.md) - Another kata using `git bisect`.
4. [pre-push](pre-push/README.md) - A quick exercise in using Git hooks.
5. [Investigation](investigation/README.md) - Discover what is going on in a Git repo, figure out what it looks like under the hood.
6. [Objects](objects/README.md) - A small exercise into Git internals.
7. [merge-driver](merge-driver/README.md) - Defining a custom merge driver.
8. [rebase-exec](rebase-exec/README.md) - Run tests on every commit using `git rebase --exec`
Loading