- Start the terminal
- Filesystem (cd, pwd, ls, tree) How does paths work!?
- Create files (mkdir, touch)
- Remove files (rm)
- Move and copy (mv, cp)
- Run commands like you're the boss (sudo)
- Install applications (aptitude, brew)
- Run programs (npm, less, tail, man)
- Download project (clone)
- Commit changes (add, commit, push)
- Get latest changes (pull)
- Create branches (branch)
- Merge branches (merge)
- Handle conflicts
Terminal for windows (with git)
- Create a directory called mydir (mkdir)
- Move to that directory (cd)
- Create a file called text.txt (touch)
- Create a directory called code (mkdir)
- Create a file called index.js inside code (touch)
- Create a file called tests.js inside code (touch)
- Create another directory called docs (mkdir)
- Create a filed called mydocs.pdf inside docs (touch)
- Rename the directory mydir to myapp (mv)
- Create a directory called img (mkdir)
- Copy an image (from your computer) into img (cp)
tree mydir (from the top) should show this:
myapp
├── code
│ ├── index.js
│ └── tests.js
├── docs
│ └── mydocs.pdf
└── img
└── some_image.jpg
3 directories, 4 files
- Install git (brew install git)
Rembember to check the status of your repository from time to time (git status)
- Go to github.com and initiate a repository
- From myapp, initiate a github repository (git init)
- Add your files to be commited (git add)
- Commit them with a fitting message (git commit)
- Add your remote github repository (git remote add origin)
- Did it work? (git remove -v)
- Push your commit to the remote repository (git push origin master)
- Remove your project from your machine (rm -rf myapp)
- Clone your project from your newly created repository (git clone)
- Create a new feature branch for you to work in (git branch)
- Checkout your new branch (git checkout)
- Remove this branch (git branch -d)
- Recreate the branch and checkout in one step (git checkout -b)
- Open code.js in your favourite editor. Add some code. Commit it. (git add, git commit)
- Checkout master (git checkout)
- Open code.js, add some other code. Commit it (git add, git commit)
- Now merge the master branch with your feature branch (git merge)
- Gosh darn! We have conflicts. Resolve them using your favourite editor (git add)
- Push your resolved code (git push)
https://brew.sh/
https://docs.npmjs.com/getting-started/installing-node