- Basic concept of Git as a distributed version control system
- Setting up Git
# You only need to run username and e-mail config once on your computer
git config --global user.name "your-name"
git config --global user.email "[email protected]"
- Cloning a remote Git repository
git clone https://some-username/name-of-repo.git
- Adding a reference to remote
git remote add <alias> https://some-username/name-of-repo.git
- Use of basic Git commands such as
git add -A # Cache changes
git commit -m "Some message" # Save the changes as a commit
git push origin master # "Push", i.e. upload, changes to a remote repository
git pull origin master # "Pull", i.e. download, changes from a remote repository
origin
-> AugFJTan/RME-Programmersupstream
-> your-username/RME-Programmers
git remote -v # View remote info
git pull origin master # Download changes from repo of origin
git push upstream master # Push changes to your forked repo
Ignore unwanted files such as Thumbs.db
, *.o
, *.exe
, etc.
View code the way you want it: utf-8
, tabs=4
, etc.
git mv <old-filename> <new-filename>
git rm <file>
git checkout -b <new-branch> # Create new branch
git branch # View existing branches
[Commit changes to new-branch
]
git push origin <new-branch> # Push branch to remote repo
git checkout master # Return to master branch
git merge <new-branch> master # merge changes from new-branch onto master
git branch -d <new-branch> # Delete new-branch locally
git push origin --delete <new-branch> # Delete new-branch on remote repo
git diff <prev-commit> <more-recent-commit>
git tag [-a] <tag-name> [-m] ["Some message"] # For latest commit
git tag <tag-name> <commit> # For older commit
git grep [options] # Search for stuff based on options
- Hex numbers
- Bit shifting
- Binary AND/OR/XOR operations