do I need to upload everything for a project to github

In this tutorial, we will acquire how to upload your palpitate project to Github. This volition be step by step guide aimed at beginner but information technology can be used by anyone. I volition be explaining past uploading Flutter project but yous 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.

We will exist 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 accept come across GitHub. Information technology is 1 of the code-heaven for developers. You can upload your projects to the platform to share it with the world and it also is a keen way to showcase your skill. To upload the code we volition be using Git which is likewise an opensource tool for version control.

Allow us get Started!!!

Getting Started

To get started and upload your flutter project to GitHub we will need some software to be installed in your PC. If you lot already have done this you tin can skip to next section.

Yous will need to have post-obit ready:

  • Git (You can get the software from https://git-scm.com/)
  • GitHub Business relationship (You can create an account for complimentary at https://github.com/ )
  • Flutter Project or any directory

In this tutorial, I will exist explaining but mode to upload the flutter project or any directory to GitHub. Installing Git, creating GitHub business relationship and configuring Git is out of the scope of this tutorial. If you would similar to know, please permit me know in the comments, I will surely make a tutorial.

Preparing Palpitate Project Directory

Now let us set our local project directory first. For this purpose open up your final or CMD for windows and go to your project directory.

cd /path-to-projection/InstaJoke/

One time you are inside the project directory, nosotros volition create empty git repository or reinitialize existing 1.

git init

In one case the repository is initialized nosotros will now add all the files in the current folder.

git add together .

Find the (dot) after add together control? That will add everything from current directory, all files and sub folders.

At this moment I will like to mention virtually .gitignore file. This file will be car-generated when y'all create the Flutter projection. If you check the content of this file, information technology will accept many files and path to the directory.

What exactly does .gitignore file practice?

Any file or folder listed in the .gitignore file will not be added to our GitHub repository. Pregnant it 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. Y'all do non want to upload this file to GitHub, just add the file to .gitignore file and information technology volition not be added.

OK, we have now added the file, side by side we volition commit. While committing the changes, we volition specify message. So with this bulletin we tin can understand what nosotros had washed with this particular commit.

git commit -yard "This is First Commit"

As this will exist our starting time commit, so with the bulletin I can sympathize information technology. For this, it might accept some fourth dimension if you have a huge number of files.

Earlier we use the terminal farther, allow us create repository on GitHub first.

Creating a GitHub Repository

To create a new repository on GitHub, you demand to visit https://github.com/ and log in to your account.

Next click on the Plus (+) symbol on height correct corner of the page and click "New Repository".

Create New Repository in GitHub

Create New Repository in GitHub

Now on the new page enter the details.

  • We will name this repository as "InstaJoke". Note: This name can be different from the project name on your PC.
  • Entering Description is optional
  • If yous do not want the public to view your project, select Private. Else keep it every bit public.

If you are good with details entered, click "Create repository" button.

Enter New Repository Details in GitHub

Enter New Repository Details in GitHub

One time the new repository is successfully created, yous will see a new page. If you get through this new page, y'all will see instructions of how to add codes to the repository.

Go along annotation of the git URL. It should look something like https://github.com/Goplax/InstaJoke.git

Successfully Create New Repository in GitHub

Successfully Create New Repository in GitHub

At present we are done with creating a repository on GitHub. Next, we will go on to add our code to this repository from our local folder.

Uploading the Flutter Project

Now let u.s.a. come back to our last. Nosotros volition now connect our local repository with the remote repository.

git remote add origin <https://github.com/Goplax/InstaJoke.git>

In one case the higher up command runs successfully. We volition now upload all our files.

git push -u origin main

Here we will be pushing all our files to the branch "master". If you are having different branch, please mention the name of that branch. This might take some time based on your file size and internet bandwidth.

You will see summary of this upload. It will be something like beneath:

Enumerating objects: 91, done. Counting objects: 100% (91/91), done. Delta compression using upwardly to iv threads Compressing objects: 100% (72/72), done. Writing objects: 100% (91/91), 53.41 KiB | two.32 MiB/south, done. Full 91 (delta 3), reused 0 (delta 0) remote: Resolving deltas: 100% (3/3), done. To <https://github.com/Goplax/InstaJoke.git>  * [new branch]      master -> main Branch 'primary' set to track remote branch 'chief' from 'origin'.        

At present you lot are done.

To check if all went expert, open the link to your code in GitHub website and you should be able to see the files there. For this project following is the link:

https://github.com/Goplax/InstaJoke

Updating the file and uploading changes to GitHub

In the above step, nosotros have seen how to create, initialize and upload your codes to GitHub using Git. Most of the time, that is not the finish of it. You will need to make changes in your projection and upload the updated file to the GitHub repository.

In this department we will run across how to practice that. Get-go make some changes to the file first. For me I am updating my README.md file.

Once you have made all the changes. Type beneath command:

git status

This command volition testify the files modified by you. It volition be something similar below:

On branch master Your co-operative is up to engagement with 'origin/master'.  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.md  no changes added to commit (utilize "git add" and/or "git commit -a")        

Next we need to add together these changes.

git add .

This will add all the files that you have changed. Next we volition commit this modify.

git commit -m "Readme file update with a link to the tutorial"

You lot volition meet the summary of this commit as shown below:

[master f35da44] Readme file update with a link to the tutorial  1 file changed, 7 insertions(+), 16 deletions(-)  rewrite README.doc (97%)

We have committed our changes. Now we will first pull the information and and so push button the changes. Nosotros are pulling first to make sure that our repository is up to appointment. This is handy if you are making changes after a long time and not sure if your repository is up to appointment or besides when you are working in a team.

git pull
git push

Once upload is done, the summary of the upload will be displayed to you.

Now you tin visit your GitHub repository page and check, the new update should be at that place.

Conclusion

I hope y'all have followed this footstep past footstep tutorial to upload your palpitate project in GitHub till the end. With that, you have learned everything from basic and is now confident. If you had faced some issue and came to find tips on the particular portion, well I am glad that I could help you.

Had you faced whatsoever difficulties on whatsoever role of the tutorial, mention in the comment section. I would be glad to aid you through.

cassidybeggermse.blogspot.com

Source: https://instacodeblog.com/uploading-your-flutter-project-to-github/

0 Response to "do I need to upload everything for a project to github"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel