Posts

Showing posts with the label git commit

Remove unwanted files from Git commit

Recently i came across the situation where i committed the unwanted files and would like to remove them from the commit and found the following help from google. First step is to do git reset the HEAD using the following command git reset --soft ^HEAD or git reset --soft HEAD~1 Next step is to remove unwanted files fro the commit git reset HEAD /path/to/unwanted file Then commit again as follows. It would probably open the editor inorder to change the commit message or you can use the same commit message. git commit -c ORIG_HEAD Hope this is helpful.

Working Locally with Git

Image
Hi, I am Malathi Boggavarapu and welcome to my blog. This tutorial describes how to create a local Git repository, adding and committing files to local repository, viewing the history of the commits, knowing the file changes made between two commits and also we discuss about Git ignore and so forth. I have a seperate post " Git Fundamentals " in my blog which explains everything about Git but i had broken them down to smaller sections to make it easy for everyone to follow. So let's get started. Working Locally with Git Creating a local repository, adding files and committing changes I have an empty directory GitFundamentals which i would like to change to local git repository. Let me explain the commands in the below image so that it would be easy to understand. git init - It creates .git directory which contains a repository and all of its metadata. I can add file to this repository by echoing "Hello, Git" to a READM...