Skip to main content

How to upload your project to Github

So you're writing all kind of codes now and you want to collaborate with other developers in your team or just simply want to back up your precious code.

There are a number of ways to do it. You could simply just a make a zip out of your project and upload it to one of the cloud storage you got. Or you could do use something that is meant for storing codes. One such service is all popular Github.

I'll leave the explanation of Github for some other day and get into business right away.

What we want to do?
We want to upload our project to a repository on Github so that anyone else or just ourselves could download it later on, or sync with our different computers.

How?
Following steps will guide you through it.

Step 1. First we need a Github account.
Go sign up here https://github.com/ and come back for more.

Step 2. We need to setup our computer such that we don't have to provide our username password every time we sync our project.
This is done using Secure Server Host(SSH)
We generate a SSH key and pass it to Settings > SSH Keys > Add Key on Github.

Before we generate SSH key let's first check if we don't already have one. Download and install GitBash if not done already.

Enter

$ ls -al ~/.ssh

to list all the keys. Source: https://help.github.com/en/github/authenticating-to-github/checking-for-existing-ssh-keys

if you see any key listed like

$ github_rsa github_rsa.pub id_rsa  id_rsa.pub known_hosts

That means you already have a ssh key. If this is your case skip to next step.
If you don't have a key, let us generate one.

You'll need a program called SSH-Keygen or OpenSSH.
Once downloaded and installed open CMD and run the following command.

$ ssh-keygen -t rsa -b 4096 -C "yourEmail@example.com"

After this you'll see something like this

Generating public/private rsa key pair.
$ Enter file in which to save the key (/home/username/.ssh/id_rsa):[Enter Name or leave blank]

You may enter a name for your SSH key or leave it blank for the default.
You may add a passphrase to this key if you want. I left it blank for a sake of easiness.

You'll see something like this after this step

Your identification has been saved in /home/username/.ssh/id_rsa.
Your public key has been saved in /home/username/.ssh/id_rsa.pub.
The key fingerprint is: /////something here/////
yourEmail@example

You've successfully generated you SSH key.
Source: https://help.github.com/en/github/authenticating-to-github/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent

Step 3. Now we need to copy this key and provide it to our Github Settings.
To copy your key run following command in CMD

$ pbcopy < ~/.ssh/id_rsa.pub

Where 'id_rsa.pub' is the name of the SSH key. In case you changed it in Step 2. you'll have to change it here as well.

Step 4. No head over to https://github.com/login
 Click on your profile picture on top-right and go to Settings.
 Under settings you'll find SSH and GPG keys, click that.
 Then in the next page that loads click "New SSH key" paste your key and save.

Step 5. Open Gitbash in the project folder you want to create a repository of.

> enter
$ git init

> enter
$ git all --all

> enter
$ git commit -m "Pushing to Git Repo"

Step 6. Now head over to Github and create a new repository.
https://github.com/new
Enter name of you repository, set private or public and click "Create Repository"
Copy the repository address and head back to GitBash we left in Step 5.

Step 7. We have our Git Repository address copied to our clipboard.

> enter
$ git remote add origin

> right click
$ git remote add origin git@github.com:userName/projectTitle.git

> enter
git push origin master

That's it. Now head over to your Github profile and check out your newly created repository.





Comments

Popular posts from this blog

Unity Mobile Game Optimization Checklist

- On Image and Text components that aren’t interacted with you can uncheck “Raycast Target” on it, as it will remove them from any Raycast calculus. - Click on your textures in your “Project” window. Click on the “Advanced” arrow, and now check “Generate Mip Maps”, Unity especially recommends it for faster texture loading time and a lower rendering time. - Set the “Shadow Cascades” to “No Cascades” (Quality settings) - If you have dynamic UI elements like a Scroll Rect with a lot of elements to visualize, a good practice is to turn off the pixel perfect check box on the canvas that contains the list and disable the items that aren’t visible on the screen. - Set all non moving objects to "Static" - Above Unity3d 2017.2 you should turn off "autoSyncTransforms" on the Physics tab - Always use Crunch Compression Low on textures - Try to keep the “Collision Detection Mode” on “Discrete” if possible, as “Dynamic” demands more performance. - You can go to the TimeManager w...

How to make download file button in react js

To create a download file button in React.js, follow these steps: Import the necessary dependencies: javascript Copy code import React from 'react' ; import { saveAs } from 'file-saver' ; Create a function that handles the download action: javascript Copy code const handleDownload = ( ) => { // Create a new Blob object with the desired content const fileContent = 'This is the content of the file you want to download.' ; const blob = new Blob ([fileContent], { type : 'text/plain;charset=utf-8' }); // Use the saveAs function from the file-saver library to initiate the download saveAs (blob, 'download.txt' ); }; Create a button component and attach the handleDownload function to the button's onClick event: javascript Copy code const DownloadButton = ( ) => { return ( < button onClick = {handleDownload} > Download File </ button > ); }; Use the DownloadButton component wherever ...

How to Convert Unreal Engine 5.1 Blueprint Project to C++ Project

To begin, open your project in the Unreal Engine 5 or a newer version of the editor.  Next, access the New C++ Class Dialog by selecting Tools and then New C++ Class .  From there, create a new "None" class and press "Create Class."  You might receive a warning message regarding the game module compilation, but you can disregard it and choose "No."  After closing any pop-ups, warnings, or success notifications, exit the Editor.  Proceed to your project's folder, right-click on the .uproject file, and select "Generate Visual Studio project files."  Double-click your project's .sln file to open it in Visual Studio.  In Visual Studio's Solution Explorer, find and choose your project.  Select "Development Editor" in the build configuration drop-down menu.  Right-click on your project and select "Build" to compile it without any errors.  Afterward, set the build configuration drop-down menu to "Development" ...