Git marks them as “Untracked files,” highlighting them in red and representing them as changes in your Working Directory. Our Working Directory consists of two text files, each having the word “Hello” inside it. Next, let’s check the status of our project by running: $ echo hello>file1.txt $ echo hello>file2.txt Let’s create two simple text files inside our directory with some text inside them: This Working Directory represents the current state of your project on your code editor. Git manages and tracks the state of our project using three trees: the Working Directory, the Staging Area or Staging Index, and the Commit History. $ mkdir git-reset-examples & cd git-reset-examples & git init Create a new directory and initialize an empty Git repository inside it: To clearly understand how git reset works, let’s do a quick refresher on Git’s internal state management. I’ll walk you through some use cases of the reset command and different ways you can implement it, along with a few examples. It can be a tad bit tricky to grasp, so I’ll demystify some underlying concepts for you in this post. You can use Git to travel back in time and safely undo your changes in a project through a command called git reset. Git may indeed dominate version control today, but it has a popular feature that many developers still don’t fully understand. When it comes to version control systems in software development, Git is the most widely used- by far.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |