A simple interactive Bash script that completely cleans and configures Git + GitHub for new systems. Ideal for fresh Linux installs or helping friends set up GitHub the right way β with browser login and test push included!
β
Cleans old Git configs and credentials
β
Prompts for GitHub username and email
β
Auto-detects installed web browsers
β
Uses GitHub CLI for secure login via browser
β
Optionally creates and pushes a test repo
β
Beginner-friendly and safe to run multiple times
Tool | Version or Status |
---|---|
Bash shell | Installed (default in Linux) |
Git | Installed (sudo apt install git ) |
GitHub CLI | Auto-installed by script if not found |
Web browser | At least one installed (e.g., Firefox, Chrome, Brave) |
Clone this repository:
git clone https://github.com/YOUR_USERNAME/github-setup.git
cd github-setup
chmod +x git-github-setup.sh
Simply run the script:
./git-github-setup.sh
.gitconfig
file if it existsgit config --global
)git config --global user.name
git config --global user.email
Auto-detects installed browsers:
Prompts you to select which browser to use for login
gh auth login
)If yes:
README.md
After running the script:
$ ./git-github-setup.sh
π§Ή Cleaning up old Git and GitHub configuration...
π§ Enter your GitHub username: md8-habibullah
π§ Enter your GitHub email: you@example.com
π Detecting installed browsers...
π» Available browsers:
1. firefox
2. brave-browser
π¦ Select browser number to use for GitHub login: 2
π Logging into GitHub...
β
GitHub successfully authenticated!
π Do you want to create and push a test repo to GitHub? (y/n): y
π Test repository pushed to GitHub!
This project is licensed under the MIT License.
MIT License Β© 2025 YOUR_NAME
Permission is hereby granted, free of charge, to any person obtaining a copy...
Q: Can I run this multiple times? A: Yes! It automatically cleans and resets everything before setup.
Q: Is SSH supported? A: Not yet β but future versions can add SSH key generation + GitHub upload.
Q: What happens to my old config?
A: Itβs backed up as .gitconfig.backup.TIMESTAMP
.
Pull requests welcome! If you have ideas (like adding SSH support, GUI version, .deb
installer), feel free to contribute.
Made by @md8-habibullah
Project: github-setup