Once you've got a commit reference, you can use it to easily revert changes or view all the changes made in the commit. This shows you all the commits which have been made to your repository in reverse order (with the most recent at the top).Īs you can see in the screenshot above, each commit has a reference, an author, a date and your message. If you want to look at a complete history of all the commits in your repository, you can do so using the git log command. You'll also be presented with a list of all the files which have been added in the commit. When you pressed enter the commit will be given a unique reference which will consist of letters and numbers. We recommend that you be as descriptive as possible to help the rest of the team identify what has been changed. The -m flag here allows you to specify a message. In the case of our first commit, it will contain all the work we have done so far. Next, we need to actually need to create a commit which will contain all these changes. If you re-run git status you'll see that all the files in your project are now under the heading "Changes to be committed". Any files in this staging area will be included in the next commit which you make. ![]() ![]() This command will add all files in the directory to our staging area. This means they haven't yet been added to our Git repository and in order to commit them, we will need to add them. In this last image, you can see that we have a number of untracked files. This allows you to see which files have recently changed or which exist in your local directory but haven't yet been added to your repository. Once the repository has been initialized, you can now run the git status command which will show you the current status of your repository. You don't really need to worry about this as you'll rarely need to go into this directory and most of the files in it are managed for you by Git. This repository will be stored in a hidden folder named. Running this command will initialize a new empty repository in our project directory. Let's now go ahead and initialize our repository. ![]() If you run the ls command, you'll see that we have a number of folders
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |