DEV Community

Cover image for Repository Environments: Remote and Development in Git
Jaine PS
Jaine PS

Posted on

Repository Environments: Remote and Development in Git

There are two main repository environments:

Image description

Remote environment and development environment.
The remote environment is where changes made to the computer are sent to a remote environment, and will be able to be shared.

The development environment is where the local machine is. This environment is made up of three parts: Working directory, Staging area and Local repository.
To take a remote repository and run it locally, use the command:

git clone - https://github.com/user_name/directory.git

Copying is done in two places, in the Working directory e no Local Repository. Why git is version distribution control.
The local repository is a literal copy of the remote repository, the only difference is that it is not shared.
Another thing that the command git clone does, is to create a folder that will contain this copy.

When a file is created, it is only present in your working directory, to see what is happening in the working directory, use the command:git status, that will tell you which branch you are working on.

After creating a file, it is placed in the staging area, this means that all changes that will be committed to the remote repository.

To send the changes to the staging area, use the command:

git add -file_name

To commit these changes to the local repository, use the command

git commit -m โ€œmessageโ€

To write good commit messages

To share your changes, and send them to the remote repo, use the command:

git push

Push sends only the changes, so it is very efficient network use.

Image description
The proper use of these commands, plus the habit of writing clear and informative commit messages, contributes to an understandable history and facilitates collaboration in software development projects.

Top comments (0)