Git Workflow Tutorial
1st - Ensure git is installed
- run
git --versionin your command line - if something like
git version 2.47.0.windows.2appears, you’re fine - if not, follow the installation tutorial at https://git-scm.com/downloads
2nd - Generate an SSH key pair [I’m assuming you have SSH installed]
- go to your home directory in the command line
- check if theres a hidden folder called
.ssh - if so, run
cd .ssh. Otherwise, SSH might not be installed … runssh -vto make sure - if you find a keypair there that you’d like to use … go to the 3rd step
- otherwise, in the .ssh folder run
ssh-keygenand just press<Enter>to everything if don’t know what’s happening - If you did everything correclty, you should have two new files in
the .ssh folder :
somethingandsomething.pub
3rd - Link to your GitHub account using the ssh key
- login into your github account and go to the main page at the
https://github.com/URL - click on your
profile picture[up right corner] - click on
Settings - your URL should be something like
https://github.com/settings/profile - find an option called
SSH and GPG keysand click on it - you should see a
New SSH keygreen button … click on it - add a
titleto your key and set itsKey typetoAuthentication Key - from your .ssh folder, copy the !!!entire!!! content of the
something.pubfile into theKeytextarea - click the
Add SSH keygreen button and you’re done!
4th - Clone the repository of our project
- go to https://github.com/supernoter/noter
- click the
Codegreen button - select the
SSHoption and copy the URL it gives you … something likegit@github.com:supernoter/noter.git - chose a place on your computer to store the local copy of the repo … I like to put it in the Desktop
- wherever it is … open the command line on that place and type
git clone git@github.com:supernoter/noter.git - accept everything … and you should see a
noterfolder there … if so, congrats!
5th - Add your own branch
- let’s say you have already created a
cardat the Trello board (https://trello.com/c/1axqVOjS/22-interface-for-configuration-file) - and let’s say you have already created an issue for your demand on github (https://github.com/supernoter/noter/issues)
- run
git branch issue-10[change the number for the number of your issue] - run
git checkout issue-10[again, change the number for the number of your issue] - do what you have to do [add files or change existing ones]
- when you’re finished, run
git add * - then, run
git commit -m '[feat] : <what you did here>(https://www.conventionalcommits.org/en/v1.0.0/) - finally, run
git pushand you’re done!
6th - Epilogue
- I’m not a mac user, so this flow might differ on a macos machine.
Search on YouTube for
SSH Github configuration on mac - Read the git documentation
https://git-scm.com/docs/gitor simply search for a git tutorial on YouTube