Welcome to NOW's practice git repository where you can make as many mistakes as you'd like and learn git while doing it. Feel free to make and send us pull requests about anything and discover how git and github work.
- Git Cheat Sheet (A list of cool features of Git and GitHub): https://github.com/tiimgreen/github-cheat-sheet
- Pro Git Book: https://git-scm.com/book
- GitHub Hello World Guide: https://guides.github.com/activities/hello-world/
- More resources: https://try.github.io/
It's as easy as 5 steps.
- Fork this repository
- Make a new branch in your fork
- Add stuff to your branch
- Commit your changes
- Send us a pull request!
You can use the Git CLI or the GitHub interface to complete these tasks.
- Download the Git CLI from here: [https://git-scm.com/downloads]
- Make an account on GitHub here: [https://github.com/join]
git clone https://github.com/username/repository
Replace username and repository with the details of the repository you want to clone.
To add a single file with name filename
git add <filename>
To add a list of files
git add <list of files>
Example: git add file1.txt file2.txt file3.txt
To add all files that have changed. git add --all
can also be used.
git add .
git rm <filename>
rm
command can be used like the add
command to remove multiple files at once by providing a list of files to be removed.
git status -s
(M) - Modified, (A) - Added, (AM) - File hasn't been altered since it was last added
git commit -m "your commit message here"
git log
To get all changes that have been committed so far, in the order that they have been committed in do git log --summary
git diff --staged
git pull
git fetch
git branch <branchname>
git merge <branchname>
git branch -d <branchname>
git branch -r
git help