GitBack is a tool designed to backup GitHub repositories either with or without authentication. It provides the flexibility to backup public repositories without authentication or to backup both public and private repositories using a GitHub Personal Access Token (PAT).
- Clone the GitBack repository:
git clone https://github.com/flarexes/gitback.git
- Navigate to the cloned directory:
cd gitback
- Build the project:
go build
-
Set up a GitHub Personal Access Token (PAT) if you plan to backup private repositories. Instructions can be found here.
-
Add your GitHub Personal Access Token as environment variable:
GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
-
Windows:
- Open Control Panel and navigate to System and Security > System > Advanced system settings > Environment Variables.
- Under System Variables, click "New" and add a variable named GITHUB_PERSONAL_ACCESS_TOKEN with your PAT as the value.
-
Linux (e.g., Ubuntu) & MacOS:
- Open your terminal and edit the .bashrc or .zshrc file using your preferred text editor (e.g., nano, vim, gedit):
nano ~/.bashrc
- Add the following line at the end of the file:
export GITHUB_PERSONAL_ACCESS_TOKEN=your_token_here
- Save the file and exit. Then, reload the shell configuration:
source ~/.bashrc
-
./gitback [flags]
-noauth
: Disable GitHub authentication. Limited to 60 requests per hour and only public data can be accessed.-username
: Required when--noauth
flag is set. Specify the GitHub username to backup public repositories.
./gitback -noauth -username flarexes
./gitback
Contributions are welcome! Please feel free to submit a pull request, I want to take this project futher.
If you encounter any issues or have suggestions for improvements, please open an issue on the GitHub repository.
This project is licensed under the BSD-3-Clause license. For more information, please see the LICENSE file.