Using Git requires getting familiar with its commands and their usage. The list below contains some of the more important commands:

  • init – Used for creating and initializing repository (project). Most often it is done on a server where the entire repository is stored.
  • clone – Download repository.
  • add – Add files to git repository.
  • commit – Add changes to current branch.
  • rm – Delete files from repository.
  • branch – Create a branch.
  • checkout – Change current branch.
  • merge – Merge two branches.
  • pull – Download changes from remote git repository and merge it with local download.
  • push – Upload changes to repository.

The use of the Git commands and their sequence depends on the action we want to perform. Below you can see an example for some of the most common actions that can be performed after downloading a Git project:

Add files to project:

  1. Copy files to downloaded repository folder.
  2. Add files using command add.
  3. Use commit to add changes.
  4. Use command push to upload changes to remote repository.

Change content of added files:

  1. Make your changes.
  2. Use commit to add changes.
  3. Use command push to upload changes to remote repository.

Delete files:

  1. Use command rm to remove files.
  2. Use commit to add changes.
  3. Use command push to upload changes to remote repository.