Here i tell about making a project and pushing the project to GitHub.
here i discuss everything about GitHub which help you to making and tell you that how you can push or pull your project to GitHub.
First of all i consider you that you have already a GitHub account.
1. Adding a project to GitHub using GitHub official website(beginner)
(a) Make log in and after you visit your profile. Just look like that
now click on new repository button
(b) Now you can see create new repository page. just look like that.
here you need to filling all required filled. after it your repository ready to go. And you are able to uploading your project files.
(c)Now it’s time to uploading your project files to your repository . see the picture.
here you some options like branch -master and upload files and create new file also. now you know that you
have already project files. Now it’s time to uploading a folder or files etc.
(d) Now you can click on uploading files and upload your files. just look like that.
here you can add a whole folder of your project or you can add files. after it use commit changes option which means you need to telling about your changes. after all your project repository is live for use by someone.
Note:- for adding folders use drag and drop option. and this option is not working for 100+ files in folder. for adding more files you need to command line interface which discuss in next section in this article.
2. Adding a project using cmd prompt or cli (intermediate)
(i) Adding an existing project to github using cli (git bash or cmd prompt)
(a) Create an new repository on GitHub. To avoid errors, do not initialize the new repository with README, license, or
gitignore files. You can add these files after your project has been pushed to GitHub.
(b) Open git Bash
(c) Change the current working directory to your local project.
(d) Initialize the local directory as a Git repository.
$ git init (e) Add the files in your new local repository. This stages them for the first commit. $ git add .
# Adds the files in the local repository and stages them for commit. To unstage a file, use ‘git reset HEAD YOUR-FILE‘.
(f) Commit the files that you’ve staged in your local repository.
$ git commit -m "First commit" # Commits the tracked changes and prepares them to be pushed to a remote repository. To remove this commit and modify the file, use 'git reset --soft HEAD~1' and commit and add the file again.
(g) At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL.
(h) 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 (i) Push the changes in your local repository to GitHub.
$ git push origin master # Pushes the changes in your local repository up to the remote repository you specified as the origin