![]() ![]() These are the commands I used to create the new file then commit them: $ echo "#network tf" > network.tf This mimics common activities if I were working on developing a Terraform plan. ![]() For my first commit I will create a new file called network.tf, then follow that commit by adding another file called storage.tf. Ok, so next we need to make a couple of changes and commits to this git branch. So the first thing I want to do is to clone the remote repository so that I can work with it locally: $ git clone :buildvirtual-git/test-repo.gitĪ quick directory listing using the ls command shows that the repo has been cloned successfully and that we have a copy of the project files in a local directory: $ ls git reset -mixed, This keeps all files the same but unstages the changes.įor this walk through I’ll be using a project containing some Terraform code which I have in a remote git repository.Be fully sure of what the impact of running this one is, use caution! ![]() git reset -hard, which will remove any changes and remove them from the local directory.git reset -soft, this will keep your files, and stage all changes back automatically.It’s important to know the implications of each one. There are a few different ways you can run a git reset. Read on to find out how to undo your changes in git using a git hard reset. With Git being a version control system (specifically a distributed VCS), previous versions of files in the project are available. With this amount of activity sometimes changes are made to files in the project which do not have the desired result, leading to you needing to revert the changes and roll back to a previous version of the code. Branches are created, files are added and changed, and files are staged and committed. When working with git on a project with multiple developers there tends to be a lot of changes to the code repository. In this article I will walk through how to do a git reset hard. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |