git commit --amend

git commit --amend -m "Edited Message"

git reset --hard HEAD~1

git reset <FileName>

git reset

git branch -d yourLocalBranchName

git push origin --delete yourRemoteBranchName

git clean -f

git reset --hard

git branch -m newBranchName

git branch -m oldBranchName newBranchName

git checkout -b newBranchName

git push origin newBranchName

git remote set-url origin newURL

git filter-branch --env-filter '





an="$GIT_AUTHOR_NAME"

am="$GIT_AUTHOR_EMAIL"

cn="$GIT_COMMITER_NAME"

cm="$GIT_COMMITTER_EMAIL"





if[ "$GIT_COMMITTER_EMAIL" = "your@email.to.match" ]

then

cn="New Committer Name"

cm="New Committer Email"

fi

if[ "$GIT_AUTHOR_EMAIL" = "your@email.to.match" ]

then

an="NEw Author Name"

am="New Author Email"

fi





export GIT_AUTHOR_NAME="$an"

export GIT_AUTHOR_EMAIL="$am"

export GIT_COMMITTER_NAME="$cn"

export GIT_AUTHOR_EMAIL="$cm"'

git clone URL

git clone URL yourFolderName

In this post we will show you what are the Top 10 frequently asked questions on Git and what are the solution of that. These solutions will help you to resolve if you stuck while using Git.This is a very common question for each individuals who have just stated using Git. Suppose you have written a wrong commit message and you want to edit you can do using the following commands.It will open a editor which will allow you to change the most recent commit.If you directly want to change the commit message, you can do usingSuppose you accidently committed some files and you want to undo that commit. At first discard the previous commit using,This command will take your HEAD pointer to the 2nd last commit. After this check all the files using 'git status'. It will show you the status of the files, then you can again add the files which you want to add using git add ...Suppose you accidentally added some files using git add but you don't want to commit those files instead want to undo those files, you can do using the below commands,// If you want to undo a single file name// If you want to undo all due changesSuppose you would like to delete a local git branch, you can useIf you want to delete a Remote branch, you can useSuppose you would like to delete all local files which you dont need to commit or to keep in your working directory, you can use the below commandOrSuppose you want to rename a local branch you can do using the below commands,For current branch,For other branch which you are not currently in,If you want to create a remote Git branch, you can use the below commands,// to create your branch locally// to push new branch to your remote serverIf you want to change the URL of a remote Git Repository (say origin) you can use the following commands.You can modify the author info in your repository's history, you can do with this script...Above Code Taken from https://help.github.com/articles/changing-author-infoTo clone a git repositor to a specific folder, you have two optionSolution 1 : Either go into that folder and typeSolution 2 :Please Like and Share the Blog, if you find it interesting and helpful.