2. Initialize, Commit & Push Your Spring Boot Project to GitHub | Git Branch & Remote Setup Tutorial

Extract the project ZIP file.

Right-click inside the extracted folder and select Open Git Bash here.

Alternatively, you can search for Git Bash in the search bar to open the terminal.

Add Project Folder to Git

Execute the command:
git add .

Commit Added Files

Execute the command:
git commit -m "First commit"

Create a Repository on GitHub

Go to GitHub and create a new repository.

1.Repository Name.
2.Description.

Check the option Add a README file.

Add a .gitignore file by selecting the Java template.

Choose a license, such as Apache License 2.1.

Click Create repository.

 After the repository is created:

Click the Code button and copy the repository URL.

Add GitHub Remote Repository

Run the command (replace the URL with your repository URL):
git remote add origin https://github.com/your-repo-url.git

Push Project to GitHub

Run the command:
git push -u -f origin main

The project will be uploaded to your GitHub repository.

You can find the related GitHub repository branch here : book-details

Leave a Reply

Your email address will not be published. Required fields are marked *