Basics of git

 

GIT Commands

git config

One of the most used git commands, email, username and file format etc. git config, which can be used to set user-specific configuration values such as the preferred algorithm for example, the following command can be used to set up email:

git config --global user.email root@exmple.in

git init

This command is used to create a new GIT directory. Sample:

git init

git add

The git add command can be used to add files to the directory. For example, the following command will index a file named README.md located in the local directory:

git add README.md

git clone

The git clone command is used for directory checking purposes.
If the directory is located on a remote server, use:

git clone someURL

git commit

The git commit command is used to commit changes to the head. Note that not all committed changes will go to the remote directory. Example:

git commit –m "Commit Msg."

git status

The git status command displays a list of files that have not yet been added or that have been changed along with the committed files. Example:

git status

git push

git push is another of the most used basic GIT commands. With a simple push, it pushes the changes made to the master branch of the remote directory associated with the working directory. Example:

git push origin master

git checkout


Post a Comment

Previous Post Next Post