Pulling basically means to pull the code on Git. This can be used in various factors such as updating the repo on your current device and filling up the missing codes/files/folders.
Use case: If you code on multiple devices, you may need to clone your repo every time you start coding on a new device and delete the previous repo. Pulling updates your repo to the version you need, making the process easier.
Available Tutorial:
Tutorial for pulling repo using terminal
Pulling Into Existing Repo From Terminal
1. Open Git Bash/Terminal
2. Navigate to the Repo
Navigate to the repo saved on your device.
3. Initialize the Branch
git checkout main
Main is the default branch. You should choose the branch you want to use.
4. Fetch Latest Changes
Fetch the latest changes from the remote repository.
git fetch origin
5. Pull Latest Changes
Pull the latest changes from the branch.
git pull origin main
Note: This will not change/update repo(folder) name.
4. Commit Changes
Commit changes basically means to save the changes you did and update it on Git/GitHub.
Available Tutorials:
Tutorial for committing changes using terminal
Tutorial for committing changes using VS Code
Commit Changes and Push Into Repo Using Terminal
1. Open Git Bash/Terminal
2. Navigate to Your Repository
3. Stage All Changes
git add .
Or, stage a specific file:
git add filename.txt
4. Commit the Changes
git commit -m “Your commit message here”
5. Push Into Repo
git push
Commit Changes Using VS Code
1. Open the Project from VS Code
2. Press
ctrl+shift+g
3. Commit Changes
Type a commit message and press on commit. You can also choose the files you want to update by pressing the plus sign.
Note: You might not see any changes if you do not save the text files or update anything. Also, you cannot commit changes if the repo is not already created on Git/GitHub.