What are commits? Commits
-
First create folder/directory on your local drive
- This step happens in the terminal + VsCode
- Command for making a directory is:
mkdir [file_name]
i.e.mkdir cli_project
- Once local directory has been created, create a remote repository
- Sign into Github, and then navigate to the
+
sign in the upper right corner and clicknew repository
- The only fields you need to modify are:
Repository name
- Give your project a name!- Then click
create repository
- You will add a license, but save this for the end
-
Back in the terminal, run the following commands:
git init
- Will initialize the local directorygit add .
-.
means all, so this command is adding all changes to your commitgit commit -m write a commit message
- command to commit,-m
stands for message and then after you want to write a commit message that makes sense.
- Things to consider for commit messages, what change did you make and where
- Write your commit messages like your life depends on it!
- Go back to the new repository page on github and copy the following last three lines
git branch -M main
git remote add origin [email protected]:aisayo/test.git
git push -u origin main
- Paste these 3 lines (you can paste all at once) in your terminal and hit enter
- Refresh your Github page and viola!