From the course: Git Essential Training
Unlock this course with a free trial
Join today to access over 24,500 courses taught by industry experts.
Git status
- Now that we know how to use Git, let's explore how we interact with our files. First, I want to show some tips on how to make it easier to keep track of what is happening. One of the most powerful commands in Git is git status. We have seen it before in a previous chapter, but I want to take the time to look at how it can help us. git status gives you a clear overview of your repository's current state. It also often suggests what you might need to do next, especially if you run into an issue. Let's see it in action. Right here, I created a new file, gitStatusDemo.md It is added to my local folder, but Git doesn't track it yet. When I use git status, it shows that there's an untracked file, meaning it hasn't been added to the staging area. Git even tells me what I can do. I can use git add, filename, to include it in the next commit. So let's do that. I'll type git add gitStatusDemo.md, and now I'll run git status again. Now, Git tells me that there are changes ready to be…
Contents
-
-
-
-
-
-
-
(Locked)
Git status2m 24s
-
(Locked)
Edit a file and view changes4m 14s
-
(Locked)
Delete files1m 35s
-
(Locked)
Rename files2m 18s
-
(Locked)
Working with folders3m 5s
-
(Locked)
Undo your changes2m 20s
-
(Locked)
View commit history4m 5s
-
(Locked)
Go back in Git history1m 52s
-
(Locked)
Revert a commit1m 55s
-
(Locked)
Make use of the GUI of Visual Studio Code2m 51s
-
(Locked)
Challenge: Make a change and revert51s
-
(Locked)
Solution: Make a change and revert2m 22s
-
(Locked)
-
-