GIT - how to use git for your project

GIT Repository

A GIT repository tracks and saves the history of all changes made to the files in a project.

It saves data in a (repository folder) directory .git

GIT uses version control system to track all changes made to the project and save them in the repository. Users can create new repositories, copy existing repositories or delete a repository for the projects.

Installing GIT:

Download and Install git from,

https://git-scm.com/

Configure git,

gitconfig --global user.email <your_email_address>

gitconfig --global user.name <your_git_user_name>

To initialize repository inside the project directory run,

git init

Add files to staging area:

git add

Commit changes:

git commit -m "Comments"

Creating repository on GitHub:

https://github.com/

SignIn or Create account

"+" to create "New repository"

Enter name, description and create repository

Connect local repository to GitHub:

git remote add origin https://github.com/<yourusername>/your-repo.git

git branch -M main

git push -u origin main



Comments

Popular Posts