screenm0nkey
screenm0nkey

Reputation: 18785

Getting a clean copy from the remote repository using git

I'm using git with an SVN repository. My local 'master' branch 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.

Upvotes: 3

Views: 7441

Answers (2)

Kit Ho
Kit Ho

Reputation: 26958

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.

Upvotes: 6

Jan Hudec
Jan Hudec

Reputation: 76236

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).

Upvotes: -1

Related Questions