Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
37 changes: 37 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
# workshops
# workshops
initial commit
3 changes: 3 additions & 0 deletions git-workshop/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/gradlew text eol=lf
*.bat text eol=crlf
*.jar binary
27 changes: 27 additions & 0 deletions git-workshop/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Java CI

on:
push:
branches:
- main
- feature/*
pull_request:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Set up JDK
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'

- name: Build with Maven
run: mvn clean install

- name: Run tests
run: mvn test
37 changes: 37 additions & 0 deletions git-workshop/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/
61 changes: 61 additions & 0 deletions git-workshop/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# Git Workshop

Welcome to the Git Workshop repository! This repo contains a simple Java project to practice real-world Git workflows.

## Prerequisites

1. Install [Git](https://git-scm.com/).
2. Install [Java 11+](https://adoptopenjdk.net/) and [Maven](https://maven.apache.org/).

## Scenarios

### 1. Create a Feature Branch

- Clone the repository:
```bash
git clone https://github.com/your-org/git-workshop.git
cd git-workshop
```

### 2. Pull and Merge Changes from Main

- Pull the latest changes:

```bash
git pull origin main
```

- Merge them into your branch:

```bash
git merge main
```

### 3. Cherry-pick a Security Update

- Cherry-pick the fix from main:

```bash
git cherry-pick <commit-hash>
```

### 4. Merge Conflict Resolution

- Modify Calculator to add missing operation
- Try to push the changes (see that your branch is 3 commits behind)
- Pull the latest changes
- Fix the conflicts in github/IDE or command line
- Push to your branch

### 5. Set up a basic workflow that echoes "Hello World" on every push

- Go to .github/workflows/ci.yml

```yaml
jobs:
echoer:
runs-on: ubuntu-latest
steps:
- name: Write following echo
run: echo 'Hello World!'
```
28 changes: 28 additions & 0 deletions git-workshop/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
plugins {
id 'java'
id 'org.springframework.boot' version '3.4.1'
id 'io.spring.dependency-management' version '1.1.7'
}

group = 'com.example'
version = '0.0.1-SNAPSHOT'

java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}

repositories {
mavenCentral()
}

dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
testRuntimeOnly 'org.junit.platform:junit-platform-launcher'
}

tasks.named('test') {
useJUnitPlatform()
}
1 change: 1 addition & 0 deletions git-workshop/contributors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Serhat
Binary file added git-workshop/gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
7 changes: 7 additions & 0 deletions git-workshop/gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.11.1-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading