how git synchronize between two different folder with same repository -
see picture above,every node indicate commit
a repository when @ c
node, clone repository in 2 different folder foldera/folderb
at foldera
reason rollback c
node , change forward d
node, push remote
then want floderb
synchronize remote , run git pull
command, auto merge
foldera
log history
* dd0b2ef add file * d795c47 first init
folderb
log history
* 2d7dd9d merge branch 'master' of http://.../git-test |\ | * dd0b2ef add file * | 186db65 second commit |/ * d795c47 first init
how let folderb
auto rollback b
not merge
if understand question correcly, want folderb
follow happens on origin
. in case, can use
git fetch origin # updates origin (but don't apply them) git reset --hard origin/master # reset working tree match origin/master git clean -fd # remove untracked files, match origin/master
Comments
Post a Comment