forked from Workshops/How-To-Git-Started
65 lines
1.2 KiB
Markdown
65 lines
1.2 KiB
Markdown
# How to Git started
|
|
|
|
## Using a GUI
|
|
You can use any GUI for git, the ones we use are Fork and Sourcetree
|
|
You can download these at https://www.sourcetreeapp.com/ and https://git-fork.com/
|
|
|
|
For other GUIs check out https://git-scm.com/downloads/guis/
|
|
|
|
|
|
### Learning objectives
|
|
- Introduction to VCS
|
|
- Create new repository
|
|
- Git ignore file
|
|
- Staging
|
|
- Committing
|
|
- Git push
|
|
- Git pull request
|
|
- Branching
|
|
- Merge / Rebase
|
|
- Undoing Commits & Changes
|
|
- Tag ?
|
|
- Log ?
|
|
|
|
|
|
## Using the terminal
|
|
|
|
### Getting started
|
|
Set up your git info
|
|
|
|
```shell
|
|
*** Please tell me who you are.
|
|
|
|
Run
|
|
|
|
git config --global user.email "you@example.com"
|
|
git config --global user.name "Your Name"
|
|
|
|
to set your account's default identity.
|
|
Omit --global to set the identity only in this repository.
|
|
```
|
|
|
|
If you want to save your https credentials run
|
|
```shell
|
|
git config --global credential.helper store
|
|
Omit --global to set the identity only in this repository.
|
|
```
|
|
|
|
## Saving changes
|
|
|
|
unstage by using
|
|
```shell
|
|
use "git reset HEAD <file>..." to unstage
|
|
```
|
|
|
|
Track remote branch
|
|
```shell
|
|
git checkout --track origin/<branch>
|
|
```
|
|
|
|
Delete remote branch
|
|
```shell
|
|
git push <remote_name> --delete <branch_name>
|
|
git remote prune <remote_name>
|
|
```
|