github - Git: which commands make a local repository identical to the remote one? -


i have read git-scm.com/book , questions on stackoverflow have been answered, still have 1 question don't answer for. here use case:

locally, have cloned remote repository (get clone). repository rather big, thousands of nested folders , files. work files in repository. of them modified. others deleted. also, files added. after i'm done changes, don't want save them in local repository (git add, git commit) , push/merge them to/with remote ones (git push). want following:

a) files changed locally being replaced corresponding files remote repository (all conflicts ignored, remote file versions have higher priority);

b) files missing locally being copied remote repository;

c) newly created files exist locally don't exist remotely remain untouched.

question: set of git commands able done?

thanks, racoon

this should it:

git reset --hard git clean -df 

the first command resets tracked files, second 1 removes untracked files. note not touch ignored files. add -x remove ignored files.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -