Git Project Link to GitHub

GitHub is a host place. Until you host your git project, all versions are kept in your local PC. Now you want to move it to a host. So here GitHub is one of the hosts. I have discussed the advantages of GitHub in my other blog.

Before moving our project to GitHub, We need to create a GitHub Repository.

Step 1. Create an account in GitHub: Here is the Link to GitHub to create an account. It is very simple to create an account. Just simply create an account here. It very simple, just go to GitHub Website and create an account.

Login Page
I have an account so I just logged in.

Step 2. Create a Git Repository: After login, now create a repository. The repository is nothing complex, It actually stores space where all the files of the project are stored.

Repository Create
Click on "New Repository" then It will open the below screen.

Repository Create step 2
Provide here a unique repository name. Choose the repository access option. Private means nobody is allowed to see your repository until you share. And Public means, everybody is always allowed to your repository. Finally, click on the Create Repository button.

Repository Created
Repository Created. Here are commands to move our local project to GitHub.

3. Push our local project to GitHub: Our Git Repository has been created. First, We will check our current project status in git bash, to see if any commits remain or not?

Current Status
Our project is clean. No commits are pending in the master branch.

Now we have to link/push our project to this repository with the below commands.

Commands - 
git remote add origin https://github.com/Roman-Sarker/Employees.git git push -u origin master OR git push -u origin main 
 

Here at first command, we have linked our GitHub repository. We choose HTTPS here. You can choose SSH. That is more secure and has also a configuration for the first-time push.

GitHub Link

Verify for first push
After run the push command it will ask to login GitHub account to be confirm that you are right person.

Once login is done, It will push automatically.

Pushed Done

Finally, refresh the GitHub page and see it successfully pushed.

Check in Browser
Our project file "Employees.txt" added


Done... 😉


Post a Comment

0 Comments