github-setup

πŸš€ GitHub First-Time Setup Script

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!


🧩 Features

βœ… 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


πŸ› οΈ Requirements

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)

πŸ“₯ Installation

Clone this repository:

git clone https://github.com/YOUR_USERNAME/github-setup.git
cd github-setup
chmod +x git-github-setup.sh

▢️ Usage

Simply run the script:

./git-github-setup.sh

🧼 What This Script Does (Step-by-Step)

1. πŸ”„ Clean Existing Configs

2. πŸ§‘ Ask for GitHub Info

3. βš™οΈ Configure Git

git config --global user.name
git config --global user.email

4. 🌐 Browser Detection

5. πŸ” GitHub Login

6. πŸ“¦ Test Repo (Optional)


πŸ“ Output

After running the script:


πŸ§ͺ Example

$ ./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!

πŸͺͺ License

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...

πŸ™‹β€β™‚οΈ FAQ

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.


🀝 Contributions

Pull requests welcome! If you have ideas (like adding SSH support, GUI version, .deb installer), feel free to contribute.


🌐 Author

Made by @md8-habibullah Project: github-setup