How to Upload Files to a Directory Github

GitHub
Source: https://almost.gitlab.com/

What is GIT ?

Git is a version command system for tracking changes in computer files and coordinating work on those files amid multiple people. The top 3 version controlling system are :

  • GIT
  • Perforce
  • Mercurial

It is primarily used for source code management in software development but it can also exist used to keep track of changes in whatsoever set of files.

Advertizing

Github : It is basically git that is hosted on cloud.

Install git from Information technology'due south official website : Click_Here

Once information technology get installed, you volition be able to find two applications on your desktop -namely, git bash and git gui

git bash and git gui on desktop

Git basic commands

Open gitbash and practice these commands :

one] To create a binder use this command on git bash

$ mkdir [folder-name]

Instance :$ mkdir tutorial

git how to create a folder

two] Now, go inside the folder

$ cd tutorial

change directory in git

3] create files inside the folder

$ nano 1.txt

This control will open a editor as shown beneath where you tin add together your content. To finish the writing session successfully press CTRL+X

Every bit soon as you stop the content writing session successfully – it will inquire y'all, whether you want to salvage the content to buffer or not.

git save to butt
Enter Y
git file save
At present , press enter

Similarly, you lot tin add n number of files.Currently nosotros have ane txt file.

git local folder

how to upload a folder to github using command line

  1. $ git init : To initiate the local binder as git initialized

    To initialize your current directory (folder) as git initialized use this command

  2. To add together files to git locally : $ git add .

    Add files to git

  3. $ git commit -m "Get-go Commit" :Save files into git file system

    To salve the files

  4. $ git remote add origin "http url of repository" :Remote login to git

    To make this available to the whole world

  5. $ git push origin master -f : Add your files to git repository

    This will forcefully push the files into github repository

iv] To initialize your current directory (folder) as git initialized use this command

$ git init

git initialized folder

5] Check the condition of the files

Once the directory has been initialized yous can cheque the status of the files, whether they are being tracked by git or not, using the below command.

$ git status

git status of the directory

Note:

  • Files are non even so added into the file directory of git
  • Unless and until, it is not added, information technology will non be monitored.

vi] Add together files to git

There are 2 means to add your files to git

  1. $ git add first.txt 2nd.txt
  2. $ git add .
add git files to repository

Note :

" . " means add all the files which are in the directory. Now, they are existence tracked by git, but not yet saved.


seven] Save these files into git file system

By using the above command the files are even so in the staging surface area – which are not saved. Utilize this command to save them

$ git commit -1000 "First Commit"

commit in git

8] Remote login to git

Your files are saved into git locally, in gild to arrive available to the whole world. Remotely login to gihub.

  • Create your github contour if you don't have from here : Click_Here
  • Create a repository : Click on new and create a repository ( basically a remote folder)
  • Create a repository " tutorial " and initiate with a readme file
how to create a repository

At present, re-create the repository link and paste it with the below command :

git repo remote url

Command :

$ git remote add origin "http url of repository"

git remote url addition

9] Add your files to github repository

$ git push origin primary

If such error occurs :

To https://github.com/madhviasthana/tutorial.git
! [rejected] master -> master (fetch commencement)
mistake: failed to push some refs to 'https://github.com/madhviasthana/tutorial.git'
hint: Updates were rejected considering the remote contains work that you do
hint: non have locally. This is usually caused by some other repository pushing
hint: to the same ref. You lot may want to first integrate the remote changes
hint: (e.g., 'git pull …') earlier pushing once more.
hint: See the 'Note near fast-forwards' in 'git push –help' for details.

Then use this command : it will forcefully push the content

$ git push origin master -f

git forcefull push

In next weblog, we will learn how to clone a remote folder in your local machine. Come across you in the next lecture!

Git Costless Tutorials For Beginners

  • How to login git in windows | Installation of GIT | GitBash login
  • Git Basic Commands | Beginners| Upload Your Local Folder To Github
  • How To Clone A Repository in Git | Git Clone | Cloning a repository…
  • GIT Branches | GIT For Beginners | GIT Pull
  • GIT Inspect and Compare | Tracking Path Changes in GIT
  • Ignoring Patterns | Rewrite History | GIT Tutorials
  • How to logout from git in windows | GIT for beginners
Join Telegram Group [90,000 + Members ] Click Here
Join WhatsApp Group [Off campus drives] Click Hither
Join WhatsApp Group [Internship drives] Click Here
Join For Amazon and Flipkart DEALS & OFFERS Click Here

New gif Terminal 24 Hours to Register

Complete Job Training Course – Crack Production Based Companies in 15 Days : 100% Applied Live Video Classes

New gif

obrienarely1955.blogspot.com

Source: https://geeksgod.com/git-basic-commands-beginners-upload-your-local-folder-to-github/

0 Response to "How to Upload Files to a Directory Github"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel