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…
This is a guide to understanding the Git workflow. Git is a system that helps track projects and changes, making it easier to revert to the original project if needed. It simplifies rewriting the project by tracking changes in files and identifying what has changed.
The process begins in the working directory, which is a folder on your laptop or computer where you work on your project. Within the working directory, you can create, edit, delete, add data, and make changes to your project. Some commands used in the working directory include pwd, ls, cd, cd.., and mkdir.
The Git workflow involves several stages. First, you work on your project in the working directory. Next, you stage the changes using the git add command, moving the changes to the staging area. The staging area is where you select which changes to save in your next commit in Git.
After staging the changes, you can check what has been staged using the git status command. You can also see exactly what has been staged using the git diff--staged command. If there are any files you want to remove from staging, you can use the git restore--staged command.
Once you are satisfied with the changes you have staged, you can commit the changes using the git commit -m command. A commit is a backup of the changes that have been placed in the staging area. Good commit messages can provide information about what happened.
Finally, you push your commits to a remote or local repository using the git push command. This is the final stage in the working directory, where your project is sent to a repository such as GitHub.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.