Skip to content

Instantly share code, notes, and snippets.

@koraysels
Last active May 8, 2023 11:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koraysels/b2f093f4f6ebc8b01d752bf7f7850e8c to your computer and use it in GitHub Desktop.
Save koraysels/b2f093f4f6ebc8b01d752bf7f7850e8c to your computer and use it in GitHub Desktop.
Git
#!/usr/bin/env bash
cd INF101AB
while read repo; do
git clone "$repo"
done < ../INF101AB.txt
cd ../INF102AB
while read repo; do
git clone "$repo"
done < ../INF102AB.txt
#!/usr/bin/env bash
find INF101AB/. -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} fetch -u origin \;
find INF101AB/. -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} reset --hard HEAD \;
find INF102AB/. -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} fetch -u origin \;
find INF102AB/. -type d -depth 1 -exec git --git-dir={}/.git --work-tree=$PWD/{} reset --hard HEAD \;
#!/bin/bash
#written by koray sels
# Define the CSV file
csv_file="repos.csv"
# Read the CSV file line by line
while IFS=',' read -r name url; do
# Clone the repository
git clone "$url" "$name"
done < "$csv_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment