Last active
January 14, 2024 12:32
-
-
Save Muminur/cdca65aa00da277caf1c22d3a0577117 to your computer and use it in GitHub Desktop.
Upload local project to your github account
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git init | |
git remote add origin https://github.com/Muminur/TranslateShopifyApp.git | |
git remote -v | |
git add . | |
git commit -m "Commit number 1" | |
git push origin master | |
If error then | |
git push origin HEAD:master | |
Go to settings, change default branch to master | |
Procedure for uploading files in GitHub using Git Bash Terminal | |
Step 1: To create a new repository, first, go to the top right of the menu bar in your GitHub account. Here, you must see a “+” sign. You can now click on it and select the first option of drop-down list i.e. “New repository” | |
Step 2: Now, you should give a name for the repository, for now I have named the repository as sample_template. Then, select “Public” option if you want to allow everyone to view what you have uploaded in repository whereas you need to select “Private” option if you want to choose the individuals who are allowed to view this repository. Then, check “Initialize this repository with a README” in case if you want to immediately clone the repository to your PC. Then, click on “Create repository” button. | |
Step 3: If you are redirected to page as shown in the image below then, your repository has been created successfully. | |
Step 4: Now, open the file which you want to upload in GitHub. | |
Step 5: Right click on file explorer in which the files that are to be uploaded opened, then click on “Git Bash Here” as shown in image below. | |
Step 6: ‘cd’ command is used in order to go to certain files. Since, we have already reached the destination which comprises of all the files that are to be uploaded in GitHub, we will not be executing the cd command. | |
Step 7: ‘ls’ command is used in order to view the files that are present in that directory. The purpose of ls command can be clear after viewing it’s implementation which has been shown in the image below. | |
Step 8: Enter command as ‘’git init”, in order to initialize an empty git repository. So, what this basically does it that it prepares your directory to be uploaded. | |
Step 9: Now, go to your repository and copy the HTTPS link which has been shown in the image below. Then, go back to Git Bash. | |
Step 10: Provide command as “git remote add origin “ then paste the HTTPS link of your repository. git remote add origin is used to add a new remote. | |
Step 11: Enter command as “git remote -v” to check if fetching and pushing is working or not. | |
Step 12: Give command as “git add .” to take all files from your directory and push it to your repository. | |
Step 13: Provide command as “git commit -m “First commit” ” to make the first commit in the GitHub repository. | |
Step 14: Finally, enter command as “git push origin master” to push the master directory to the origin. | |
Step 15: Now, go to your GitHub repository and refresh the link. In the repository, you can now see that all the files have been uploaded. | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment