To create a private repository in a GitHub organization and push your code using the GitHub CLI (gh), run the gh repo create claremont-computer-network/<repo-name> --private --source=. --push command directly from your local project folder.
Before running commands, ensure you are logged into your GitHub account with the correct permissions.
gh auth login
Follow the prompts to log in via your browser or an auth token.
Open your terminal, navigate to your local code folder, and initialize it as a Git repository if you have not already done so.
cd /path/to/your/local/project
git init
git add .
git commit -m "Initial commit"
Run the following single command. Replace <repo-name> with your desired repository name.
gh repo create claremont-computer-network/<repo-name> --private --source=. --push
Would you like to learn how to add collaborators to this new private repository using the CLI, or do you need help setting up a template for your project files?