Introduction to Tools: Day 1 - Nepali Coding Bootcamp
The following are some things you should be able to do by the end of this module: - Sign up on Github.com - Download git bash - Navigate files using the UI (Windows Explorer) - Find and open a command line application (Git BASH) - Understand and use the command line - Understand Pathing and Hierarchical Structures (Parent & Child folders and file structures) - Remember the basic BASH commands cd, ls, and pwd - Understand what source control is - Understand what Git is and the workflow To Get GitBash What is a File System: - Files are like papers in a folder, but on a computer. They hold information we want to keep. - Folders are like big containers that hold other containers called sub-folders and files. All the files are inside a folder on a computer. - Files and folders have special information called metadata that tells us things like when they were last changed, who owns them, and who can look at them. This special information is part of the computer's filing system. For Window please use GIT BASH and for Mac Use Terminal. To move around in your folders, you can type "cd" followed by a command: Tilde - "cd ~ /user/name/jjd" takes you back to your main folder, called the home directory. - "cd "directory name" takes you to a specific folder, like a room in a house. - "cd .." moves you up one level in the folder structure. - To see what folder you're in, type "pwd" - Print working directory. - To see what files are in a folder, type "ls". - These are just short ways to type out longer words: cd means change directory, ls means list, and pwd means print working directory. Sometimes we need to change the computer's files and folders. Here are some ways we can do it: - To make a new folder, we can use the command "mkdir 'directoryname'". - To delete an empty folder, we use the command "rmdir 'directoryname'". - To delete a file, we use the command "rm 'filename.extension'". - But be careful! If we add "-r" to the delete folder command, it will delete everything in the folder, even other folders and files inside. So we need to be very careful when using "rm -r 'directoryname'". Source Control: - Source control is like a way for computer programmers to keep track of their work. They use special software, like git or bitbucket, to save different versions of their code. This helps them keep organized and go back to older versions if they need to. - With git, the programmer has a copy of their work on their own computer, and also on a main computer somewhere else. This means they can work on their own and then share their changes with others. Configuring Git: git config --global user.name "yourname" git config --global user.email "youremail" When programmers want to save their work using git, they need to follow these steps: 1. They can check what files they have changed by typing "git status". 2. Then they need to tell git which files to save by typing "git add -A". This is like putting the files in a box to be saved. 3. Next, they need to actually save the files to their computer by typing "git commit -m "'commit message'". This is like putting the box of files on a shelf in their room. 4. Finally, they can share their saved work with others by typing "git push origin main". This is like taking the box of files from their shelf and putting it in a shared storage room. Few More Git Commands 1. git init: Initializes a new git repository in the current directory. 2. git clone: Creates a copy of an existing repository. 3. git pull: Downloads changes from a remote repository to the local repository. 4. git branch: Lists all branches in the repository. 5. git checkout: Switches between different branches in the repository. 6. git merge: Combines changes from two or more branches into a single branch.
The following are some things you should be able to do by the end of this module: - Sign up on Github.com - Download git bash - Navigate files using the UI (Windows Explorer) - Find and open a command line application (Git BASH) - Understand and use the command line - Understand Pathing and Hierarchical Structures (Parent & Child folders and file structures) - Remember the basic BASH commands cd, ls, and pwd - Understand what source control is - Understand what Git is and the workflow To Get GitBash What is a File System: - Files are like papers in a folder, but on a computer. They hold information we want to keep. - Folders are like big containers that hold other containers called sub-folders and files. All the files are inside a folder on a computer. - Files and folders have special information called metadata that tells us things like when they were last changed, who owns them, and who can look at them. This special information is part of the computer's filing system. For Window please use GIT BASH and for Mac Use Terminal. To move around in your folders, you can type "cd" followed by a command: Tilde - "cd ~ /user/name/jjd" takes you back to your main folder, called the home directory. - "cd "directory name" takes you to a specific folder, like a room in a house. - "cd .." moves you up one level in the folder structure. - To see what folder you're in, type "pwd" - Print working directory. - To see what files are in a folder, type "ls". - These are just short ways to type out longer words: cd means change directory, ls means list, and pwd means print working directory. Sometimes we need to change the computer's files and folders. Here are some ways we can do it: - To make a new folder, we can use the command "mkdir 'directoryname'". - To delete an empty folder, we use the command "rmdir 'directoryname'". - To delete a file, we use the command "rm 'filename.extension'". - But be careful! If we add "-r" to the delete folder command, it will delete everything in the folder, even other folders and files inside. So we need to be very careful when using "rm -r 'directoryname'". Source Control: - Source control is like a way for computer programmers to keep track of their work. They use special software, like git or bitbucket, to save different versions of their code. This helps them keep organized and go back to older versions if they need to. - With git, the programmer has a copy of their work on their own computer, and also on a main computer somewhere else. This means they can work on their own and then share their changes with others. Configuring Git: git config --global user.name "yourname" git config --global user.email "youremail" When programmers want to save their work using git, they need to follow these steps: 1. They can check what files they have changed by typing "git status". 2. Then they need to tell git which files to save by typing "git add -A". This is like putting the files in a box to be saved. 3. Next, they need to actually save the files to their computer by typing "git commit -m "'commit message'". This is like putting the box of files on a shelf in their room. 4. Finally, they can share their saved work with others by typing "git push origin main". This is like taking the box of files from their shelf and putting it in a shared storage room. Few More Git Commands 1. git init: Initializes a new git repository in the current directory. 2. git clone: Creates a copy of an existing repository. 3. git pull: Downloads changes from a remote repository to the local repository. 4. git branch: Lists all branches in the repository. 5. git checkout: Switches between different branches in the repository. 6. git merge: Combines changes from two or more branches into a single branch.