# Git Commands
- Find Git Repository URL: `git config --get remote.origin.url`
- Check local status: `git status`
- Reset to latest branch head:
Warning: This command will throw away all your uncommitted changes. For safety, you should always check that the output of `git status` is clean (that is, empty) before using it.
`git reset --hard`
- Open Git UI: `gitk`
- Merge branch:
- Fast-forward Merge Example:
```
# Start a new feature
git checkout -b new-feature master
# Edit some files
git add <file>
git commit -m "Start a feature"
# Edit some files
git add <file>
git commit -m "Finish a feature"
# Merge in the new-feature branch
git checkout master
git merge new-feature
git push origin master
# Delete the branch
git branch -d new-feature
```
- Merge with commit: `git merge --no-ff <branch>`