# Updating source tree with git



## Robert Kopp (Jan 21, 2021)

This post is somewhat similar to previous threads, but I want to make sure I understand this new procedure. I run 12-STABLE and have been updating with svnlite:
`svnlite checkout https://svn.freebsd.org/base/stable/12 /usr/src`

So I suppose I need to delete or rename the present source tree before proceeding. Is this right?
`git clone -b stable/12 --depth 1 https://git.freebsd.org/src.git /usr/src`

And this can be kept current with cd /usr/src; git pull. But I also see git config pull.ff only, and wonder whether this is really necessary? Anyhow I hope this is included in the Handbook in the near future.


----------



## msplsh (Jan 21, 2021)

Nuke (delete everything from) /usr/src since it's not a git repo and everything in there will confuse it (and possibly you).

--ff-only is for refusing to update if you modify your copy, it seems?









						What is Git fast-forwarding?
					

Is it OK to assume that fast-forward means all commits are replayed on the target branch and the HEAD is set to the last commit on that branch?




					stackoverflow.com


----------



## ljboiler (Jan 22, 2021)

msplsh said:


> Nuke (delete everything from) /usr/src


... especially the .svn directory, as this is where SVN stores all its metadata and is rather large.


----------



## SirDice (Jan 22, 2021)

I suggest you give net/gitup a try.


----------

