- Create a new repository on GitHub. Or you can use Intellij like in image ,
- Open Git Bash.
- Change the current working directory to your local project.
- (Go to current project working directory like: My_Project)
- Initialise the local directory as a Git repository.
1. git init
1. Commit the files that you've staged in your local repository.
git commit -m "First commit"
In the Command prompt, add the URL for the remote repository where your local repository will be pushed.
git remote add origin remote repository URL
# Sets the new remote
git remote -v
# Verifies the new remote URL
Push the changes in your local repository to GitHub.
git push origin master
Done π