GIT for newbie (PART 1)
Tags: git, productivity, github, programming
Published: 2024-05-16 12:34:21

## **HOW TO ADD ANY FILES INTO HOSTING PLATFORMS (GitHub,GitLab,etc)**

## About this article
 
This article show us how to add your program file into hosting platform like GitHub, GitLab, etc. We do this by using git version control tool. Git tool is different from GitHub and GitLab.

[Git](https://git-scm.com/) is a distributed version control system that tracks changes in any set of computer files, usually used for coordinating work among programmers who are collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different computers).

Follow the following steps to upload your file into hosting platforms.

1. First of all download git from [here](https://git-scm.com/downloads). Git is inbuilt software for Linux, to conform that type `git --version` in terminal.

2. Open the git bash on your windows, mac and type `git --version` to conform that git downloaded successfully. I will use the word terminal, for windows and mac users it same as git bash. 

3. Choose your file (the file you want to upload) by typing `cd file_name, dir`. `cd file_name` for choose folder and `dir` for showing all files in current folder. This command varies with OS.

4. Type `git init` for add local git file (.git) into your system. You can locate this file by entering into the folder that you located early and turn on hidden files. You can see a .git file in this folder.

5. Make necessary edit in the programming file and type in terminal  `git status` to conform file edited successfully and follow below commands.

6. `git add — all` for choose all the coded file.
`git commit -m “new file added”` for locally save the code with a message. 

7. `git remote`
`git remote add origin https://github.com/ARUNKRISH11/Sample` 
Adding git repo link (for each project first time only need this line of command). The link will get by creating new repository in GitHub or GitLab. For creating new repository in GitHub follow the instructions in the below image named 'Create new repository in your GitHub.'

8. To see the remote name and link used previously use `git remote` or `git remote -v`

9. `git push origin master` to uploading the file into your GitHub repository.

10. After that you need to enter hosting platform username and token ID “ARUNKRISH11, ghp_G3cketo8dqEKrp6ubZh3h5GYs5vClDF”
You can generate token id in GitHub by follow the instructions in the below image named 'Create new repository in your GitHub'

All commands used in this post

```
git --version
cd file_name
dir
git init
git status
git add --all
git commit -m "new file added"
git remote
git remote add origin https://github.com/ARUNKRISH11/Sample
git push origin master
```
_Steps done in terminal or git bash_
![Steps done in terminal or git bash](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/j531ckw7wa4gqwzcmxr3.jpg)
_Create new repository in your GitHub._
![Create new repository in your GitHub.](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vty97duz5edtgs5g7c8t.jpg)
_Generate GitHub personal access token ID_
![Generate GitHub personal access token ID](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5ibkaqgqov2qt3anb560.jpg)


_Thank you for taking the time to read through this Git explanation post! I hope it has clarified some of the key concepts and features of Git for you. Whether you're a beginner just starting out or an experienced developer looking to brush up on your skills, Git is an invaluable tool for version control and collaboration._

_A big shoutout to the awesome developer community here for always fostering an environment of learning and growth. Your questions, feedback, and contributions are what make this community so special._

_Feel free to share your thoughts, ask questions, or provide additional tips in the comments below. Let's keep the conversation going and continue to learn from each other!_

_Happy coding! 🚀_