Motivation:
You want to use Git to version your files or share your files with other people.
Solution:
- Register a GitHub or a GitLab account.
- Create a GitHub repository or a GitLab project.
- Download and install a Git client.
- Push a folder with files to the server.
mkdir "D:\NETCORE" git init git add *.* git commit -m "add initial files" git remote add origin https://github.com/huybien/asp.net-core.git git push -u origin master
- Push changes to a remote repository.
git add . git commit -m "CP form" git push -u origin master
- Update (fetch and merge) a local repository.
git pull
- Force updating (fetch and overwrite) the current repository.
git fetch --all git reset --hard origin/master git clean -fd git pull
- Force updating (fetch and overwrite) a local repository (e.g. C:\Users\admin\Downloads\code).
git -C C:\Users\admin\Downloads\code fetch --all git -C C:\Users\admin\Downloads\code reset --hard origin/master git -C C:\Users\admin\Downloads\code clean -fd git -C C:\Users\admin\Downloads\code pull
- Pull (checkout) a remote repository (e.g. https://github.com/huybien/asp.net-core.git) to an empty local folder (e.g. C:\Users\admin\Downloads\code).
cd C:\Users\admin\Downloads\code git init git remote add origin -f https://github.com/huybien/asp.net-core.git git pull origin master or git pull origin main
- Reset (Revert) a local repository to a previous version.
cd C:\Users\admin\Downloads\code git log --oneline git reset --hard 4355842 where 4355842 is a version id.
(Visited 37 times, 1 visits today)