https://drive.google.com/drive/folders/11YV9bqOE44pIyt_7uzh9uudnhMhNMt9u
MAKE SURE THAT GIT IS INSTALLED ON THE WINDOWS HOST !!!
If Git is not installed on the Windows host, download and install it in powershell/cmd:
winget install --id Git.Git -e --source wingetUpdate Git:
git update-git-for-windowsCheck for Git version:
git --versionAfter that create a new repository on GitHub, clone that repository to your Windows host. Follow step in section 2.1 to make changes in this local repo. When you reach the step to push the code, a GitHub login window will appear as shown below:
Choose Sign in with your browser, sign in GitHub account and changes are updated to GitHub.
Above steps - Install the latest Git for Windows in order to share credentials & settings between WSL and the Windows host.
Configure Git Credential Manager
_ If GIT installed on the Windows host is >= v2.39.0, type this command in WSL:
git config --global credential.helper "/mnt/c/Program\ Files/Git/mingw64/bin/git-credential-manager.exe"For older Git version and more detail please visit the link in the end of this section
_ Set up your username and email that will be used for commits:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"After complete configuration, use Git as usual on WSL.
Above is the summary of the article "Get started using Git on Windows Subsystem for Linux"
For more detail information, access the following link: https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-git
Cloning a project from GitHub: (IMPORTANT)
git clone <repository-url>To check the status of your repository and see if there are any changes:
git statusMake changes then add those changes to the staging area: (IMPORTANT)
git add <file-name> # To stage a specific file, or
git add . # To stage all modified filesSee the specific changes you've made to the files before staging them,
git diffAfter staging the files, commit changes with a descriptive message: (IMPORTANT)
git commit -m "Your commit message"View the history of commits:
git logSend local commits to the GitHub repository: (IMPORTANT)
git pushPull the latest updates from the remote GitHub repository: (IMPORTANT)
git pullInitialize a Local Working Directory to Local Git Repository:
git initMake changes then use some commands in section 1.1: add, commit
Go to GitHub and log into your account, then create a new repository.
Add the GitHub Repository as a Remote:
git remote add origin <repository-url>Change the main branch name from "master" to "main" :
git branch -M mainPush the Local Repository to GitHub:
git push -u origin main
Just do above commands for the first time, after that use other commands in section 2.1 as usual.
