How to Upload Folder to Github Terminal
In this tutorial, we will acquire how to upload your flutter project to Github. This will be pace past step guide aimed at beginner but it can be used by anyone. I will be explaining by uploading Palpitate project only you tin use this method to upload any project or directory.
I will be using the InstaJoke project that I take created in the post titled Acquire HTTP Request in Flutter with API call to be uploaded.
Nosotros will be using the Git version control system and the GitHub to store our code. If you follow opensource community or have searched for any opensource application then you lot accept come beyond GitHub. Information technology is one of the code-heaven for developers. You tin upload your projects to the platform to share information technology with the world and it also is a great manner to showcase your skill. To upload the code we will be using Git which is likewise an opensource tool for version control.
Let united states of america get Started!!!
Getting Started
To get started and upload your palpitate projection to GitHub nosotros volition need some software to be installed in your PC. If you already have done this you can skip to side by side section.
You volition need to have post-obit fix:
- Git (You can get the software from https://git-scm.com/)
- GitHub Business relationship (Yous can create an business relationship for gratuitous at https://github.com/ )
- Flutter Projection or any directory
In this tutorial, I will be explaining only way to upload the flutter project or whatsoever directory to GitHub. Installing Git, creating GitHub business relationship and configuring Git is out of the scope of this tutorial. If y'all would like to know, please permit me know in the comments, I will surely make a tutorial.
Preparing Flutter Project Directory
Now allow us ready our local project directory first. For this purpose open your terminal or CMD for windows and go to your project directory.
cd /path-to-project/InstaJoke/
Once you lot are inside the projection directory, nosotros volition create empty git repository or reinitialize existing 1.
git init
Once the repository is initialized nosotros volition now add all the files in the current binder.
git add together .
Notice the (dot) later add command? That will add everything from current directory, all files and sub folders.
At this moment I will like to mention nigh .gitignore file. This file volition be machine-generated when you create the Palpitate project. If you check the content of this file, it will have many files and path to the directory.
What exactly does .gitignore file practice?
Whatever file or folder listed in the .gitignore file will not be added to our GitHub repository. Meaning information technology will be ignored. This is very important if you are sharing your source code to the public. For example, you might have a new file with some credentials. You exercise not want to upload this file to GitHub, just add together the file to .gitignore file and it volition not be added.
OK, we have now added the file, adjacent we volition commit. While committing the changes, nosotros will specify message. And then with this message we can sympathize what we had done with this particular commit.
git commit -chiliad "This is Get-go Commit"
Every bit this will be our first commit, so with the message I tin sympathise it. For this, it might take some time if yous have a huge number of files.
Before we use the terminal further, let us create repository on GitHub first.
Creating a GitHub Repository
To create a new repository on GitHub, you lot demand to visit https://github.com/ and log in to your account.
Side by side click on the Plus (+) symbol on height right corner of the page and click "New Repository".
Now on the new page enter the details.
- We volition name this repository as "InstaJoke". Annotation: This proper name can exist different from the project name on your PC.
- Entering Description is optional
- If you exercise not want the public to view your project, select Private. Else keep information technology every bit public.
If y'all are adept with details entered, click "Create repository" button.
Once the new repository is successfully created, you volition see a new page. If you go through this new page, y'all volition see instructions of how to add together codes to the repository.
Continue annotation of the git URL. It should look something similar https://github.com/Goplax/InstaJoke.git
At present we are done with creating a repository on GitHub. Adjacent, nosotros volition proceed to add our code to this repository from our local binder.
Uploading the Flutter Projection
Now permit us come back to our terminal. Nosotros will now connect our local repository with the remote repository.
git remote add together origin <https://github.com/Goplax/InstaJoke.git>
Once the in a higher place command runs successfully. We will at present upload all our files.
git push -u origin primary
Here we will be pushing all our files to the co-operative "master". If you are having different co-operative, please mention the name of that co-operative. This might accept some time based on your file size and internet bandwidth.
You will see summary of this upload. Information technology volition be something like below:
Enumerating objects: 91, done. Counting objects: 100% (91/91), done. Delta pinch using up to 4 threads Compressing objects: 100% (72/72), done. Writing objects: 100% (91/91), 53.41 KiB | 2.32 MiB/s, done. Total 91 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), done. To <https://github.com/Goplax/InstaJoke.git> * [new co-operative] primary -> master Branch 'main' gear up to track remote co-operative 'chief' from 'origin'.
At present y'all are done.
To bank check if all went good, open the link to your lawmaking in GitHub website and y'all should be able to see the files at that place. For this project following is the link:
https://github.com/Goplax/InstaJoke
Updating the file and uploading changes to GitHub
In the above step, we accept seen how to create, initialize and upload your codes to GitHub using Git. About of the time, that is not the stop of it. Yous will need to make changes in your projection and upload the updated file to the GitHub repository.
In this section we will see how to do that. Commencement make some changes to the file first. For me I am updating my README.md file.
In one case you have fabricated all the changes. Type below command:
git status
This command will show the files modified by yous. It will exist something like beneath:
On co-operative master Your branch is up to date with 'origin/principal'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: README.medico no changes added to commit (apply "git add" and/or "git commit -a")
Side by side we demand to add these changes.
git add .
This volition add all the files that you have inverse. Next we volition commit this modify.
git commit -m "Readme file update with a link to the tutorial"
You will meet the summary of this commit equally shown below:
[master f35da44] Readme file update with a link to the tutorial ane file changed, vii insertions(+), sixteen deletions(-) rewrite README.doc (97%)
We have committed our changes. Now we will first pull the data and then push the changes. We are pulling first to make sure that our repository is up to date. This is handy if y'all are making changes afterward a long time and not sure if your repository is upwards to date or likewise when y'all are working in a squad.
git pull
git push
Once upload is done, the summary of the upload will be displayed to you.
Now you can visit your GitHub repository page and cheque, the new update should be there.
Conclusion
I hope you have followed this step by step tutorial to upload your flutter project in GitHub till the end. With that, you lot have learned everything from bones and is at present confident. If you had faced some outcome and came to detect tips on the item portion, well I am glad that I could assistance y'all.
Had you faced any difficulties on any part of the tutorial, mention in the comment section. I would be glad to aid you through.
Source: https://instacodeblog.com/uploading-your-flutter-project-to-github/
0 Response to "How to Upload Folder to Github Terminal"
Postar um comentário