Skip to content

Commit 56c31bb

Browse files
authored
Initial Setup
1 parent b90a64e commit 56c31bb

3 files changed

Lines changed: 43 additions & 1 deletion

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: Check One File Commit
2+
3+
on: [push]
4+
5+
jobs:
6+
verify-files:
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout code
10+
uses: actions/checkout@v4
11+
12+
- name: Check that b.txt exists
13+
run: |
14+
if [ ! -f "b.txt" ]; then
15+
echo "❌ b.txt is missing."
16+
exit 1
17+
else
18+
echo "✅ b.txt is present."
19+
fi
20+
21+
- name: Check that a.txt does NOT exist
22+
run: |
23+
if [ -f "a.txt" ]; then
24+
echo "❌ a.txt should not be present."
25+
exit 1
26+
else
27+
echo "✅ a.txt is not present."
28+
fi

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,11 @@
1-
# gitgud02-commit-one-file
1+
2+
# Assignment - Hello World
3+
4+
This assignment contains two files: a.txt and b.txt. Both are already added to staging. You only want to add b.txt to staging, but you don't want to lose your changes to a.txt.
5+
6+
## Instructions
7+
* run start.sh
8+
* Remove a.txt from staging
9+
* Commit changes
10+
* Push to main
11+

start.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
echo 'A' > 'A.txt'
2+
echo 'B' > 'B.txt'
3+
git add A.txt
4+
git add B.txt

0 commit comments

Comments
 (0)