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.
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.
Click on "New Repository" then It will open the below screen. |
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. 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?
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.
git remote add origin https://github.com/Roman-Sarker/Employees.git git push -u origin master OR git push -u origin mainHere 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.
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.
Finally, refresh the GitHub page and see it successfully pushed.
Our project file "Employees.txt" added |
Done... 😉
0 Comments