Skip to content

Git Basics

The directory you are working in ~/src/ltrops2341/pod-5 is a Git repository. This means you can use Git commands to track changes to the files you edit or create.

Note

Remember to commit frequently and use meaningful commit messages to make your changes easier to understand and track.

By following these steps, you ensure your work is saved, tracked, and shared effectively.

Steps to commit and push changes

Add files to Staging

After editing one or multiple files, use the following command to stage all changes in the current directory and all subdirectories:

git add .

Commit the changes

Once the files are staged, commit the changes with a descriptive message that helps to track the changes:

git commit -m "a meaningful message"

Push the changes to the repository

Push your committed changes to the remote repository:

git push
This command uploads your changes to the Git repository on the server, making them available to others.

Verify

You can verify the status of your repository at any time using:

git status
This command shows which files are modified, staged, or untracked.