Name | Comments |
---|---|
git-scm | The best place (imho) to learn everything about Git (through reading) |
Interactive Git Branching Learning | Visual and interactive way to learn Git branching |
Learn git concepts, not commands | Article on Git concepts |
Codeacademy Learn Git | Not Free |
Git for Computer Scientists |
- Clone a repository:
git clone https://github.com/bregman-arie/devops-resources.git
- Pull changes from remote repository:
git pull
- Pull changes without trying to merge the changes between the local branch and the remote one:
git pull --ff-only
- Switch to a branch called "main":
git checkout main
- Create (if doesn't exists) and switch to a branch called
devel
:git checkout -b devel
- List branches:
git branch
- Update based on status of remote branches:
git remote prune origin
- Delete local branch:
git branch -d some-branch
- See what the current status in the repository:
git status
- Add changes to the staging area:
git add <FILE>
orgit add .
to add everything
- Create a commit:
git commit
- List of latest commits:
git log --oneline
- Push commits to the remote branch:
git push origin main
- Revert to commit X
git revert --no-commit X..HEAD
git commit