How to upload flutter project to GitHub?
By: Juhi Padmaja
Tags: Flutter, Flutter Tutorial, Github, Upload, Flutter App Development

Flutter is a SDK(Software Development Kit) for creating beautiful User Interfaces and it was created by Google.

Flutter tutorial- Upload flutter project to Github

Hello everyone. This is Juhi Padmaja here. Here I wrote a blog on “How to upload your flutter project to Github?”. There are 8 simple steps to do this easily. The steps are very easy to follow. I hope this will be very useful for you indeed.

First open the command prompt on Windows.

STEP 1

You have to get into the flutter project folder where you have created the flutter project using the command prompt on Windows. Here I have already created a flutter project named “newapp”. So I used “cd” command to get into that flutter folder.

You have to create a new repository on your GitHub account. Here I am creating a new repository in my GitHub account.

Click on “New” button (highlighted in the below picture) to create a new repository.

After clicking on “New” button, it will prompt you to a page where it shows to “Create a new repository”. You can type the repository name as you wish. Here I gave it as “newrepodemo” for the repository name. You have to choose “public” radio button if you have to create a new public repository. You have to choose “private” radio button if you have to create a new private repository. Here I opted for a public repository.

After that you have to select the button “Create repository” to create a new repository on your GitHub.

Now you have to click on the profile icon in the right upper corner so that the below page will be opened where your entire profile and your repositories will be displayed. So below your profile icon, there will be your USERNAME which I highlighted in the below screenshot. Copy that username and have it for the next step.

STEP 2

Then type the command “git config — global user.name <YourGitHubUsername>” on the command prompt. Now use your USERNAME for this command. I have used my username here that is “JuhiPadmajaP”.

STEP 3

Type the command “git config — global user.email <YourEmailID with which you signed in to GitHub account>”. Here I used my mail.

STEP 4

Type the command “git init” on the command prompt. It will initialize the empty Git repository in your Flutter project folder.

STEP 5

Type the command “git add .” on command prompt in Windows. This command will basically add all the folders of your flutter project to your GitHub repository. Ignore the warnings if it shows any.

STEP 6

Type the command “git commit -m <My First commit>” on the command prompt in Windows. This command will commit your project to the GitHub repository. You could commit it using any message which might be related to the stuffs that you commit to your repository.

STEP 7

Type the command “git remote add origin https://github.com/(YourGitHubUsername)/(name of the public or private repo that you have created in GitHub).git”.

STEP 8

Type the command “git push -u origin master” on your command prompt in Windows.

So after typing this command, it will ask you for your User Name, which is your email id that you use to sign in into your GitHub account, you have to give it. Then it will ask for your password too.

After entering all these credentials, this command will push all the files under master branch.

Finally the flutter project will be uploaded to your GitHub repository as shown below. You could go and check your GitHub account and all the folders will be uploaded.

Thank you so much for reading my blog. I hope that this helps you in some way to upload your flutter project to GitHub. Have a good day.