How To Upload A Local Project To Github In A Branch
Upload file to github command line. Today we volition acquire how to easily upload project or file on github using command line. Get-go nosotros will create a new repository on github and after we will fill the repository name and clarification.
Upload Project/Files On Github Using Control line
Follow the few steps and successfully upload file or project on github using command line.
Pace i – Create New Repository
We demand to create a new repository on GitHub website. Go to link and create repository click here . Click New repository from the menu on your right once y'all are logged into your GitHub account.
Create new repository On Github
Fill the repository name and clarification of your project.
Step 2 – Now Open cmd
Now go to the Terminal on your calculator system. Use cd to navigate to the local project directory that you desire to publish on GitHub.
CD to navigate to your directory
cd/your_directory_name
Step 3 – Initialize Local Directory
Now nosotros will intialize our projection. Utilize the below command to initialise the local directory as Git repository.
git init
Pace 4 – Add together Local repository
Add all the files in the local directory to staging using the command below.
git add together .
This control stages all the files in the directory, ready for commit.
Footstep 5 – Commit Repository
You tin now commit the staged files using the command below. It is explanatory and helpful.
git commit -m "First commit Bulletin"
Pace 6 – Add Remote Repository url
Now, re-create the remote repository URL provided by github to you when yous published your repository on GitHub.
Now we will add the copied URL for your GitHub repository every bit remote repository using the lawmaking beneath.
git remote add origin https://github.com/yourusername/your-repo-name.git
This control add together our GitHub repository as a remote that you can then button your local repository changes.
Stride 7 – Push Local Repository to github
In the final step, use the beneath command line in your terminal to push button the local repository to GitHub. It will upload the file or project on github.
git push origin master
If you apply -u in the control, it will remember your preferences for remote and branch and you tin merely use the command git push next time.
git push button -u origin chief
Step 8 – Pull Repository from github
Pull the desired branch from the upstream repository. This method will retain the commit history without modification.
git pull origin chief
All the command to employ upload the file and projects on github.
cd/your project directoryi) git init
2) git add together . or git add ['filename']
three) git commit -grand "My get-go File"
4) git remote add origin https://github.com/yourusername/your-repo-name.git
v) git pull origin master
vi) git push origin main
In merely few minutes. We have successfully upload the project or file on github using command line
Recommended Tutorials
Source: https://www.tutsmake.com/upload-project-files-on-github-using-command-line/
Posted by: ishambouselt.blogspot.com
0 Response to "How To Upload A Local Project To Github In A Branch"
Post a Comment