DEV Community

Dorcas Chebet
Dorcas Chebet

Posted on

ASSIGNMENT WEEK 1

Understanding the Git workflow.

Introduction

Git is a system that is used incase one needs to track their projects or check if there was changes or need to get back to the initial project.
Git is important since it simplify the work of re-writting the project over again by keeping track on the initial project through tracking the changes in the file or checking on what has changed or under certain changes.
A complete work flow involves,

  • working directory

  • staging area

  • commit

  • push

    working directory.

    It is a folder in your laptop or computer where you work on your project .Working directory is where you:

  • create files

  • edit files

  • delete files

  • add data and make changes to your project.
    The commands that are used in the working directory include,

  • pwd-it shows your current location

  • ls_it is used for listing files and a folder.

  • cd folder-it moves into a folder.

  • cd..-it is used if one needs to move back to the previous folder.

  • mkdir-it creates a new file folder.

  • touch file-wit creates a new empty folder.

  • git status-command used in tracking a folder.

  • git add-moves changes to staging area.

    staging area.

    It is where you put the changes you have chosen to save in your next commit in git.

    The commands that are used in staging area:

  1. git add- stage all the changes

  2. git status- check what is staged

  3. git diff--staged -sees what is exactly staged

  4. git restore--staged-it removes a file from staging

  5. git commit -m -it ensure you run git add before committing

    Commit

    It is a back up of the changes that have been placed in the staging area.
    Good commit messages can tell what happened.

    Push

    Git push is a command that takes the commits made in a computer and send them to a repository such as Github.It is the final stage in working directory that sends the project to remote or local repository.

Top comments (0)