Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kfcampbell/git-basics-example
Example repo for workshop on git tooling
https://github.com/kfcampbell/git-basics-example
Last synced: 13 days ago
JSON representation
Example repo for workshop on git tooling
- Host: GitHub
- URL: https://github.com/kfcampbell/git-basics-example
- Owner: kfcampbell
- Created: 2024-03-21T21:48:04.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-29T23:42:29.000Z (8 months ago)
- Last Synced: 2024-12-15T22:30:41.413Z (25 days ago)
- Language: Shell
- Size: 15.6 KB
- Stars: 0
- Watchers: 1
- Forks: 9
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# git-basics-example
The purpose of this repository is to show off the git flow for use in @kfcampbell's "git basics" demonstration.
## Usage
To run the script, open a terminal and execute `./facts.sh`.
(For Keegan, to separate dummy auth from his machine's auth):
To build the Dockerfile, run `docker build -t facts .` To run the container, run `docker run --rm -it facts`. To connect to that container from VS Code, open the Command Palette and run Attach to Running Container.## `git` command reference
### Branching
- `git branch`
- show branches and see what branch you're on
- `git switch -c yourNewBranch`
- create a new branch and switch to it
- `git switch yourExistingBranch`
- switch to an existing branch
- `git branch -D yourExistingBranch`
- delete a branch (uppercase D because we want to delete it even if it's not fully merged)## Commit loop
- `git status`
- what's changed since the last commit?
- `git add {fileOrPatternMatcher}` to stage file for commit
- `git restore --staged {fileOrPatternMatcher}` to unstage file(s) for commit
- `git commit -m "{yourMessage}"` to add a commit with a simple message
- `git reset HEAD~1` to "undo" a local commit
- `git commit --amend` to alter a commit message## Commit log
- `git log` to show all commits on a branch
- `git show {commitSHAOrBranch}` to view details of a single commit## Remote sync
- `git pull` to fetch changes from the remote and merge them into your local branch
- `git push` to push local changes to the remote
- `git remote -v` to show all remotes