Follow along as I document my work, life and projects.
- Setting up the Mac
- Starting a new SPA project
- Building a SPA layout using Tailwind
- Get started with git version control
- Install open source Feather icons
- How to add Vuex and Axios to your project
- Let’s setup TablePlus the database GUI
- How to add Laravel Auth to your Vuejs project
- How to import Marked Markdown into your Vuejs project
Chances are you have git already installed and you can check that by running git — version. If you don’t have git installed just hit brew install git in your terminal and you’re done.
Let’s configure git globally.
- Set up your username git config — global user.name = ‘Ben Fisher’
- Set up your email address (obviously add in your correct email address)git config — global user.email = ‘email@example.com’
- Let’s initialise the project so we can add version control to the project. First make sure you are in your project root directory using the cd comand. Next run git init. This will add a .git folder to your directory
- Next I’m going to add the files I want to track by running git add .
- And I’m going to commit my initial commit by running git commit -m ‘initial commit’
- I use bitbucket but you can use github or gitlab as your main repository. First I’m going to add a new repository to bitbucket — https://bitbucket.org/repo/create
- Next you will be given some instructions on how you can link your local repository to your bitbucket repository and it will look something like this git remote add origin firstname.lastname@example.org:benjifisher/project-name-v1.git
- If you have a fresh environment like me you will need to first generate a public/private rsa key pair by running ssh-keygen -t rsa
- After the prompt to save the key just hit enter and enter passphrase or not to your preference
- Now we need to add the ssh keygen file by following these instructions — https://guides.co/g/bitbucket-101/11181
- Also link up your bitbucket account and local repository. Instructions found here — https://confluence.atlassian.com/bitbucket/set-up-an-ssh-key-728138079.html#SetupanSSHkey-ssh2
- You can now push to your bitbucket repository once the setup is complete git push -u origin master
The last few steps can be tempormental so don’t give up if you hit a few uncertainties. That’s just the nature of software development. Little tip, if you have to create the config file from scratch use vim to edit the file once it has been created with the touch command.
For future updates all you need to use (for now) is the following commands from your terminal:
- git status
- git add .
- git commit -m ‘name of your commit’
- git push -u origin master
If you ever need to test new code or install dependecies and roll back changes you can use:
- git reset HEAD — hard (removes any tracked changes that have not been committed)
- git clean -fd (cleans out anything not in the staging area)
Once git has been setup correctly and Atom restarted you will notice changes highlighted in your repository by Atom — for more information go here.
That’s it for today. Let me know if you have any tips or tricks to share with others.
Until next time!