Switch to your PowerShell window, and enter the following:
git clone repository_url
Important: In the example above, the command will clone the repository over HTTPS. Another option is cloning with SSH URLs. For that option to work, you must generate an SSH key pair on your Windows workstation and assign the public key to your GitHub account.
cd git_project
Note: Replace git_project with the actual name of the repository you downloaded. If it’s not working, you can list the contents of the current directory with the ls command. This is helpful if you don’t know the exact name or need to check your spelling.
Once you’re in the sub-directory, list the remote repositories:
git remote -v
Once you’ve done some work on the project, you may want to submit those changes to the remote project on GitHub.
1. For example, create a new text file by entering the following into your PowerShell window:
new-item text.txt
2. Confirmation that the new file is created.
3. Now check the status of your new Git branch and untracked files:
git add text.txt
4. Add your new file to the local project:
git add text.txt
5. Run git status again to make sure the text.txt file has been added. Next, commit the changes to the local project:
git push
You may need to enter your username and password for GitHub.
Configure your local Git installation to use your GitHub credentials by entering the following:
git config --global user.name "github_username"
git config --global user.email "email_address"
git config --global init.defaultBranch main
# You can simply type
> emptyfile.txt
# This will create a empty text file with name "emptyfile"
# This same as doing
echo "" > emptyfile.txt