How To Upload Files To Make Anew Github Repository
Git is a version management arrangement.Its an open up source and is most widely versioning tool today.Here we will see how to manage the files in a Git repository.
To manage the files using Git we need to add the files to the Git Repository.We can interact with Git either through the GUI or Git Command line.Nosotros will be using the Git control line(as well called Git bash) hither.
Git command line
To start the git command line right click on the folder you want to manage with Git. If Git is installed on your machine and so on right clicking on a folder options to open Git using UI and command line or git fustigate will be displayed.Select the "Git Bash here" option.
Git bash command prompt opens
To verify if Git bash has opened correctly merely type git.A help displaying the important git commands is displayed.
A git repository is a working directory that contains all the history of the changes fabricated to the directory.To verify if a directory is a git repository just encounter if the directory contains a .git subdirectory.Every git repository is supposed to incorporate a .git subdirectory and it is this subdirectory which is responsible for tracking all the changes in the repository.
It is important to understand that working directory or the directory with which we directly interact is goose egg but the repository in Git.This is is different client server versions control systems such every bit SVN in which a central server contains the repository.The reward is that the dependency of the users is removed from the central server and users can work with the repository without any connexion to the server.
Post-obit are the steps to create a new repository and add files to it.
Creating a new repository
A new repository tin can be created equally
- Open Git bash as described above.
- Change the current directory to the working directory
- Type "git init" at the command line Bulletin is displayed that an empty repository has been initialized.
You can verify that a new directory having the name ".git" is created in the repository we just initialized.
Add a file to the repository
- Below we added a new file in our directory. If you take an existing file y'all can apply that file instead.
2. Type the post-obit command at the command prompt
$ git add "Exam Document.txt"
The above command will add the file to the Git Index as well known as Staging expanse.
three. Verify if the new file has been staged
To verify if the file has been added to the Index type git status command at the command prompt.If the file has been successfully staged then the post-obit message will be displayed.
4. Commit
To really add the file to the repository from the Staging area we need to perform commit.To commit the file blazon the post-obit command:
$ git commit "Test Certificate.txt"
Now we have added our file to the Git repository and Git will maintain the different versions of the file as we brand changes and perform commits.
Reader Interactions
Source: https://codecompiled.com/adding-file-git-repository
Posted by: blackledgethatepat.blogspot.com
0 Response to "How To Upload Files To Make Anew Github Repository"
Post a Comment