If you want to find out the branches which you have created. Please follow the below steps
Go to Visual Studio (Git
->Git Bash)
Type the below command as
git branch
Find out by author Name:
git log --author="AuthorName"
Example: git log --author="Uday Kumar"
Output: It will display all your commit id and branches which you created from beginning.
You can also use regular expressions to create more complex searches. For example, the following command searches for commits by either Vijay Bhasker or Krishna Chaitanya
git log --author=" Vijay Bhasker \| Krishna Chaitanya"
Note that the author’s email is also included with the author’s name, so you can use this option to search by email, too.
git branch -a
(shows both remote and local branches.)
git branch -r
shows remote branches
Now I click on save to commit this File.
TO DELETE A COMMIT
If you commited one file in commit by mistake and want to delete that commit id (Assume GlobalDataConfiguration.config)
I have modified the GlobalDataConfiguration.config
Now I want to delete that Commit Id.
You can use the below command
git reset --hard HEAD~1
The HEAD~1
means the commit before head.
Or, you could look at the output of git
log, find the commit id of the commit you want to back up to, and then do this:
git reset --hard <sha1-commit-id>
After deleting the commit id you can see that page is getting loaded.
No comments:
Post a Comment
Thank you for visiting my blog