Git basics pt1

Git basics pt1

·

2 min read

Hey guys, This is me writing my first blog. Wish me good luck ✨

Git

Git is a version control system to keep track of changes to files and projects over time. So, Git and GitHub are different here is what GitHub is.

GitHub

Github is a website that hosts Git repositories(folders that contain intentional snapshots of progress called commit ) online, making it easier for developers to share codes. GitHub is for storing, tracking and collaborating on software projects

To start with it you should first download Git

  • git init: This is the first step in creating a repository, this command turns the directory into an empty Git repository.

  • git add: This command adds files into the staging area of Gits before the file is available to commit to a repository, the file needs to be added to the stage area. Different ways to use git add :

    #for all files
    git add .
    
    #for a specific file
    git add index.html
    
  • git commit: Records the changes made to the file to a local repository and you should include a message with each commit explaining the changes made in a commit.

    #m for message
    git commit -m 'added index page'
    
  • git status: This command is used to display the states of the repository and staging area. It allows us to see tracked and untracked files and changes.

stay tuned for part2

Did you find this article valuable?

Support Yusra by becoming a sponsor. Any amount is appreciated!