HomeGit

Git

How To Delete A Branch In Git?

Delete a local branch: `git branch -d branch-name` Force delete a local branch: `git branch -D branch-name` Delete a remote branch: `git push origin --delete branch-name` Delete...

How To Revert A Commit In Git?

`git revert ` `git revert HEAD` `git revert --no-edit ` `git revert -n ` `git reset --soft HEAD~1` `git reset --mixed HEAD~1` `git reset --hard HEAD~1` `git checkout -- ` `git...

How To Reset Local Changes In Git Of Edited File?

`git restore ` `git checkout -- ` `git restore .` `git checkout -- .` `git reset --hard HEAD` `git clean -fd`

How To Use Git?

Install Git Configure your name and email Create or open a repository Check repository status Add files to the staging area Commit changes View commit history Create and switch branches Merge branches Pull...

How To Clone A Git Repository?

Open a terminal or command prompt Navigate to the directory where you want the repository copied Run `git clone ` Replace `` with the HTTPS or SSH...

Trending Today