Skip to content

Instantly share code, notes, and snippets.

View harshraj8843's full-sized avatar
🎯
6w24239346

Harsh Raj harshraj8843

🎯
6w24239346
View GitHub Profile
#!/bin/bash
# Fetch all repositories for the authenticated user
repos=$(gh repo list --no-archived --json name --jq '.[].name')
# Loop through each repository and archive it
for repo in $repos; do
echo "Archiving repository: $repo"
gh repo archive "$repo"
done
@harshraj8843
harshraj8843 / private_fork.md
Created December 23, 2023 14:53 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

#!/usr/bin/env python3
# find files with same extension inside sub-directories
import os
extensions = ['.c', '.cpp', '.cs', '.java', '.py', '.go', '.php']
for ext in extensions:
dc = fc = 0
@harshraj8843
harshraj8843 / pull.txt
Created September 22, 2021 04:40
Create pull request with specific commit (for forked repos)
# If you haven't set up your remote yet, run this line:
# git remote add upstream https://github.com/konradjk/exac_browser.git
git fetch --all # Get the latest code
git checkout -b my-single-change upstream/master # Create new branch based on upstream/master
git cherry-pick b50b2e7 # Cherry pick the commit you want
git push -u origin my-single-change # Push your changes to the remote branch