开发者

Getting a clean copy from the remote repository using git

I'm using git with an SVN repository. My local 'master' bra开发者_高级运维nch is a little messed up and every time i do a git svn rebase I end up in all sorts of issues, which neither me or the guys I work with can fix. So is there a way I get just get a clean copy from the remote repository which will just overwrite all the changes in my local branch.


Reset will change all your tracked files into your remote repository

git reset --hard 

Clean -xdf will also clear all your untracked files in your repository

git clean -xdf

This will help you to make a "whole" clean repository.


Do you mean:

git reset --hard trunk

That will make current branch point at specified revision (reset with revision) and worktree match (--hard). Your previous version remains in reflog until git gc 90 (configurable) days later.

Note, that the name of trunk might be different as it depends on your particular setup (I have svn/trunk, but I believe I've defined the svn/ prefix when initializing git-svn).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜