use git pull URL
.
Example:
# cd to my git project dir cd ~/git/example_init # pull from a remote repository git pull https://github.com/example.git |
This will update your local repository (and working dir) from remote server.
# get latest from remote but without merging into local git fetch --all
git reset --hard origin/master |
here's another way.
# discard local changes git reset --hard
# delete all untracked local files and dirs. (DANGEROUS) git clean -xdf
|
Fresh Clone of new repo
git remote add upstream https://github.com/project/project git fetch upstream git checkout master git reset --hard upstream/master git push origin master --force |