We're gonna learn Git with a simple example so let's git started (haha 😃). What is required for this kata ?
Git installed on your computer/laptop
Make sure that git is already installed altough it should be the case. For Debian/Ubuntu distro, you can use this command to install git:
sudo apt install git
You can download the installer from their website git and just install it.
- Create a folder named git-started.
- Open Git Bash (Windows) / a terminal (Linux) inside the folder.
- We're gonna init a repository locally with this command:
git init
- The default branch is named main or master. We're gonna rename it to dev.
git branch -m dev
- Create a file named hello_world.txt with this command:
echo "console.log("Hello World");" > hello_world.txt
Alternatively you can use your favorite text editor.
- Now we're gonna track this file so it can be saved:
git add hello_world.txt
- Then we're gonna save the changes we made (creating this file and putting content inside):
git commit -m "chore: display hello world with js"
- Now create a repository named hello-world on Github.
Make sure to choose public and nothing else after.
- To link the your local repository to your remote repository copy these two links:
Make sure to use yours 'cause it is different for users and change the branch to dev
- Your local repository is now linked to your repository on Github.