Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
5 changes: 3 additions & 2 deletions list-organization-repos.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
. ./.gh-api-examples.conf

# https://docs.github.com/en/rest/reference/repos#list-organization-repositories
# GET /orgs/:org/repos
# https://docs.github.com/en/enterprise-cloud@latest/rest/repos/repos?apiVersion=2022-11-28#list-organization-repositories
# GET /orgs/{org}/repos

# Demonstrates paging

Expand All @@ -13,3 +13,4 @@ curl ${curl_custom_flags} \
-H "Accept: application/vnd.github.v3+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}" \
"${GITHUB_API_BASE_URL}/orgs/${org}/repos?page=${page}&per_page=${per_page}&type=${type}"

43 changes: 30 additions & 13 deletions make-commits.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,39 @@
. ./.gh-api-examples.conf

export number_of_commits=10
export number_of_commits

cd src

git clone https://${U}:${token}@${hostname}/${org}/${repo}.git
if [ -d src/${repo} ]; then
cd src/${repo}
else
echo clone the repo first
./clone-default-repo.sh
fi

cd ${repo}
pwd
git branch
git checkout ${new_branch}
git branch

mkdir -p make-n-commits
timestamp=$(date +%s)

echo "Creating: ${number_of_commits} commits"
for d in `seq 1 ${number_of_commits}`;
do
pwd;
echo $d;
touch file$d.md;
echo $d >> file${d}.md
git add file$d.md;
git commit -m "adding file $d";
echo "==============================================="
time git push
echo "==============================================="
filename=make-n-commits/file-${timestamp}-commit-number-${d}.md
touch ${filename}
echo $d >> ${filename}
git add ${filename} > /dev/null
git commit -m "adding file: ${filename}" > /dev/null
done

timestamp_end=$(date +%s)

let "duration_seconds=$timestamp_end - $timestamp"
echo "Creating: ${number_of_commits} commits took ${duration_seconds}"

echo "Running git push: ${number_of_commits} commits"
echo ================================================
git push
echo ================================================
1 change: 1 addition & 0 deletions make-n-commits/file-1715325165-commit-number-1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1