How to Upload a Project on Github

Install Git on PC

Goto Repo Folder Right click

Hello developers, in this tutorial i am going to hash out about git. Then in this git tutorial i will explain step by step why do you demand git and github and how to set up git in your motorcar with SSH keys. I remember this git tutorial is going to be the all-time git tutorial. Hope y'all will relish it. Let'due south start.

Why practise yous need to utilize Git?

Git is becoming an 'industry standard'. If you desire to become a meliorate developer, yous may need to use Git to develop software and interact with other developers. Git lets you manage code development in a virtually countless diversity of way. Here are benefits of using Version Control System/Git:

  1. Git allows y'all to create as many branches of your project as you want. Yous can use each branch to test, create a new feature, set bugs, etc.
  2. You can meet what was changed in your project's files. This helps you understand what happened and improve your lawmaking
  3. Yous can easily store all the versions of your site and restore previous versions whenever you desire.
  4. Store your files on deject-based Git repository host services like Github and Bitbucket.
  5. You can easily share your files with others
  6. A VCS or Git helps your squad work more efficiently. Anybody knows what is going on and can merge the changes into a mutual version.

How to install Git?

Note:if you don't know how to run a control, please read the Recipe 1 – Introducing CLI (Command Line Interface).

Install Git on Mac

The easiest way is to install the Xcode Command Line Tools. Yous can do this past only running this control.

BashCopy

Click Install to download Command Line Tools package. Alternatively, you lot tin as well find the OSX Git installer at this website:

http://git-scm.com/download/mac

Install Git on Windows
Yous tin can download GitHub for Windows to install Git:

https://windows.github.com

Install Git on Linux/Unix
You can install Git past running this command:

BashCopy

If you're on a Debian-based distribution, utilize this:

BashCopy

Configuring Git

When you first install Git, you should prepare your proper name, e-mail address and enable coloring to pretty upwards command outputs. Open your CLI and run these commands:

1 git config --global user.name "Your Proper noun" 2 git config --global user.email "Your Email Accost" 3 git config --global color.ui machine          

BashCopy

Note: Think to replace Your Proper name and Your Electronic mail Address.

Set ssh on your reckoner.

Now we accept to prepare our ssh keys. let's do it

  1. Expect to encounter if y'all have files~/.ssh/id_rsa and~/.ssh/id_rsa.pub.
  2. If not, create such public/private keys: Open up a last/shell and type:
$ ssh-keygen -t rsa -C "your_email@example.com"          

BashCopy

Note: (Don't blazon the$; that just indicates that you're doing this at the command line.)

Copy your public fundamental (the contents of the newly-createdid_rsa.pub file) into your clipboard.On a Mac, in the last/shell, type:

$ pbcopy < ~/.ssh/id_rsa.pub          

BashCopy

Paste your ssh public key into your github business relationship settings.

  1. Go to your githubAccount Settings
  2. Click "SSH Keys" on the left.
  3. Click "Add SSH Key" on the correct.
  4. Add a label (like "My laptop") and paste the public key into the large text box.
  5. In a final/vanquish, type the following to test it:

BashCopy

If it says something similar the post-obit, it worked:

Hi username! You've successfully authenticated, only Github does not provide shell access.          

HTMLCopy

Read also How to Recursively Remove .DS_Store Files on Mac OS

Start versioning your projection using Git

Git is very simple to use. First, yous need to go to your working directory

BashCopy

Note: If yous're using Homestead, the Lawmaking directory is where nosotros will put our Laravel apps. Lawmaking/Laravel is your working directory. You can utilise Git on Homestead or on your local automobile, it's up to you.

Now we tin use the git init command to initialize Git:

BashCopy

This control creates an empty Git repository. If yous're using Homestead, the path of the Git directory is:

/home/vagrant/Code/Laravel/.git/ .".git" is a hidden folder and it doesn't comprise your projection'southward files yet.https://googleads.yard.doubleclick.internet/pagead/ads?guci=2.2.0.0.2.2.0.0&customer=ca-pub-6486651952335863&output=html&h=280&adk=730391896&adf=1345762465&pi=t.aa~a.2913246760~i.106~rp.4&w=611&fwrn=4&fwrnh=100&lmt=1611478963&num_ads=1&rafmt=1&armr=three&sem=mc&pwprc=4470375599&psa=1&ad_type=text_image&format=611×280&url=https%3A%2F%2Fwww.codecheef.org%2Farticle%2Fyour-outset-time-with-git-and-github&flash=0&fwr=0&pra=3&rh=153&rw=610&rpe=ane&resp_fmts=3&wgl=1&fa=27&adsid=ChAIgNK0gAYQt9Thv5ig5bYqEkgA_NMiwCtp-M9DfRcZUsPLpbSrEeJ1wH_W2YfmCxOhKlbNkDzBiZuKA4TIcX6D05og7OnOyQq5OowOA1ZTzQH6ajgnHZ76Nyk&dt=1611478955069&bpp=4&bdt=602&idt=iv&shv=r20210120&cbv=r20190131&ptt=9&saldr=aa&abxe=one&cookie=ID%3Df8bb2aad36f9b1dc-228d9afdcfc5000f%3AT%3D1611475774%3ART%3D1611475774%3AS%3DALNI_MaOAaMuO2WqBi3e9FdDOtgWWdg6gw&prev_fmts=0x0%2C307x250%2C307x250%2C307x250&nras=2&correlator=340803742900&frm=20&pv=one&ga_vid=566983705.1611475772&ga_sid=1611478955&ga_hid=1819497929&ga_fc=0&u_tz=330&u_his=20&u_java=0&u_h=768&u_w=1366&u_ah=728&u_aw=1366&u_cd=24&u_nplug=3&u_nmime=four&adx=369&ady=3226&biw=1349&bih=568&scr_x=0&scr_y=992&eid=42530672%2C21067982%2C21068769%2C21065724&oid=iii&pvsid=3209514089438148&pem=88&ref=https%3A%2F%2Fwww.codecheef.org%2Farticle%2Fsubcategory%2Fmac-tools&rx=0&eae=0&fc=1408&brdim=0%2C0%2C0%2C0%2C1366%2C0%2C1366%2C728%2C1366%2C568&vis=ane&rsz=%7C%7Cs%7C&abl=NS&fu=8320&bc=31&jar=2021-01-24-09&ifi=5&uci=a!5&btvi=3&fsb=1&xpc=Z8knvVjpuO&p=https%3A//world wide web.codecheef.org&dtd=8527

Add and commit your files
At present we can use git status command to check the status of our working directory:

BashCopy

Y'all will see a list of untracked files, that means Git doesn't monitor those files yet.

setup-git-first-time

To tell Git that you want to include all these files, use the git add -A command:

BashCopy

Note:Alternatively, you tin utilize git add –a or git add –all or git add . control.

When we run the git condition command over again, y'all'll see:

setup-github

The git add command tells git to add changes in your project to the staging area. However, those changes aren't saved yet until y'all run git commit:

git commit -m "Get-go commit"          

BashCopy

Note:You can use the -m flag (stands for bulletin) to give a comment on the control line. My message is "Get-go commit", just y'all can use whatever you like. Well done! Yous've fabricated your offset commit!

Push your project to Github

Your new repository (repo) is empty. Y'all need to upload your files to that Github repo. Every repository has a unique remote URL, your remote URL should look like this: https://github.com/YourGithubUsername/YourRepoName.git Have annotation of this link. Proficient! We will endeavour to upload our Laravel app (/Code/Laravel) to Github.

BashCopy

You now have your files on the deject!

Cloning a repository

To download any repo, you tin use the git clone command. First, navigate to the location where yous want to place the cloned directory:

BashCopy

Blazon git clone and the unique remote URL to clone the repo:

git clone https://github.com/YourGithubUsername/YourRepoName.git          

BashCopy

This command creates a local clone of the repository on your computer.

Annotation: yous can clone whatever public repository. If you don't want anyone to download your repo, set it private.

Hope you lot've enjoyed this tutorial.

hillbossubjectis73.blogspot.com

Source: https://laravel2018.wordpress.com/2021/01/20/how-to-upload-push-project-on-github/

0 Response to "How to Upload a Project on Github"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel