gitworkflow

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
gitworkflow [2015/10/31 04:22] – Update & cleanup KubilayKocakgitworkflow [2021/12/14 20:46] (current) – Since this is the top Google result, Give users half a chance of finding the official git repo and 'git clone' URI. DavidOBrien
Line 1: Line 1:
 +The official %%FreeBSD%% Git repo is now at https://cgit.freebsd.org/src/
 +
 +Clone TL;DR:
 +(public-mirror)
 +https://git.FreeBSD.org/src.git
 +ssh:%%//%%anongit@git.%%FreeBSD%%.org/src.git
 +(developers-only)
 +ssh:%%//%%git@gitrepo.%%FreeBSD%%.org/src.git
 +
 +The content of this page needs to be updated, please refer to the latest doc from git migration WG at https://github.com/bsdimp/freebsd-git-docs/ , and the discussion on https://lists.freebsd.org/mailman/listinfo/freebsd-git .
 +
 +Update: 2020-12-14: These are not the repositories for the 2020/2021 svn to git conversion, please see the note above. The below is mostly historic information and will soon be entirely obsolete.
 +
 ====== Introduction ====== ====== Introduction ======
  
-This page describes the official git repositories of the %%FreeBSD%% project that can be used as common repositories to+This page used to describe the inofficial git mirrors of the SVN repositories of the %%FreeBSD%% project that could be used as common repositories to
 base other work on. base other work on.
  
-The repositories are read-only mirrors of the [[https://www.freebsd.org/doc/handbook/svn.html|src, doc and, ports FreeBSD Subversion repositories]] +The repositories were read-only mirrors of the [[https://www.freebsd.org/doc/handbook/svn.html|src, doc and, ports FreeBSD Subversion repositories]]
- +
-Using git to commit changes to these repositories is not officially supported (but doable). Instead it aims to serve as +
-a collaboration point by using additional tools like Github, Gitorious, or Gerrit, etc.+
  
 Bear in mind that git does not replace use of Subversion in %%FreeBSD%% and the Bear in mind that git does not replace use of Subversion in %%FreeBSD%% and the
 repository is currently offered on a best-effort basis only. The steps to recreate the conversion are outlined below, so that people can replicate the process in-house should they wish to. repository is currently offered on a best-effort basis only. The steps to recreate the conversion are outlined below, so that people can replicate the process in-house should they wish to.
  
-CAVEAT EMPTOR: It is possible (but highly unlikely) that the repositories might need to be re-done due to bugs in the converter.+CAVEAT EMPTOR: It is possible that the repositories might need to be re-done due to bugs in the converter.
 This would result in changed commit IDs for the impacted branches. This would result in changed commit IDs for the impacted branches.
 As the actual tree objects for a certain SVN revision will remain identical, it will always be possible to rebase or merge your work on these new branches and not run into any merge conflicts. As the actual tree objects for a certain SVN revision will remain identical, it will always be possible to rebase or merge your work on these new branches and not run into any merge conflicts.
 Advance notice will be provided if this proves necessary, along with advice on the required git commands. Advance notice will be provided if this proves necessary, along with advice on the required git commands.
 +
 +In fact, "bad SVN metadata" escaped into the published repos on github.com, so they **will** be re-rolled at some future date.
  
 ====== Repositories ====== ====== Repositories ======
Line 21: Line 33:
 The repository mirrors are updated at least hourly. Should they lag the SVN repository by more than a day, please create a [[https://bugs.freebsd.org/bugzilla/enter_bug.cgi?component=Git%20Integration&product=Services|new Bugzilla Issue: Git Integration]]. Monitoring still needs to be put into place, help wanted btw. The repository mirrors are updated at least hourly. Should they lag the SVN repository by more than a day, please create a [[https://bugs.freebsd.org/bugzilla/enter_bug.cgi?component=Git%20Integration&product=Services|new Bugzilla Issue: Git Integration]]. Monitoring still needs to be put into place, help wanted btw.
  
-  * **[[https://github.com/freebsd/freebsd.git]]** +As of 2020-12-14, canonical repository of doc has been migrate to git: 
-  * **[[https://github.com/freebsd/freebsd-doc.git]]** + 
-  * **[[https://github.com/freebsd/freebsd-ports.git]]** (the preferred sources) +  * https://cgit.freebsd.org/doc/ (web repository browser) 
-  * git:%%//%%git-beta.freebsd.org/freebsd-base.git +  * ''%%https://git.FreeBSD.org/doc.git%%'' (readonly, geographically distributed mirror for cloning through https) 
-  * git:%%//%%git-beta.freebsd.org/freebsd-doc.git +  * anongit@git.%%FreeBSD%%.org:doc.git (readonly, geographically distributed mirror for cloning through anonymous ssh) 
-  * git:%%//%%git-beta.freebsd.org/freebsd-ports.git (the canonical sources)+  * git@gitrepo.%%FreeBSD%%.org:doc.git (read/write for committers to push) 
 + 
 +ports: 
 +  * **[[https://github.com/freebsd/freebsd-ports.git]]** (the preferred sources for cloning and browsing) 
 +  * https://cgit-beta.freebsd.org/ports/ (the canonical sources, web repository browser) 
 +  * ''%%https://cgit-beta.freebsd.org/ports.git%%'' (the canonical sources for cloning) 
 + 
 +src: 
 +  * **[[https://github.com/freebsd/freebsd.git]]** (the preferred sources for cloning and browsing) 
 +  * https://cgit-beta.freebsd.org/src/ (the canonical sources, web repository browser) 
 +  * ''%%https://cgit-beta.freebsd.org/src.git%%'' (the canonical sources for cloning)
  
 ====== Quick Start ====== ====== Quick Start ======
Line 36: Line 58:
 $ git clone --config remote.origin.fetch='+refs/notes/*:refs/notes/*' https://github.com/YourGitUserName/freebsd.git $ git clone --config remote.origin.fetch='+refs/notes/*:refs/notes/*' https://github.com/YourGitUserName/freebsd.git
 $ cd freebsd && git pull   # For some reason, the notes will not be fetched during the clone operation ... $ cd freebsd && git pull   # For some reason, the notes will not be fetched during the clone operation ...
-$ hack, hack, hack+(hack, hack, hack)
 $ git commit $ git commit
 </code> </code>
Line 48: Line 70:
  
 See any other git howto or documentation if you're stuck on the basics. See any other git howto or documentation if you're stuck on the basics.
-A useful reference for the issue with notes is http://git-scm.com/2010/08/25/notes.html.+A useful reference for the issue with notes is [[https://git-scm.com/book/en/v2|Pro Git book, written by Scott Chacon and Ben Straub and published by Apress]].
  
 ===== Adding SVN Revision Notes to an Existing Clone ===== ===== Adding SVN Revision Notes to an Existing Clone =====
Line 78: Line 100:
  
 [[GitWorkflow/GitSvn#Merging_pull_requests_from_github_using_git-svn_.28FreeBSD_committers_only.29|Merging pull requests from GitHub]] [[GitWorkflow/GitSvn#Merging_pull_requests_from_github_using_git-svn_.28FreeBSD_committers_only.29|Merging pull requests from GitHub]]
- 
-===== Experimental git-svn bootstrap ===== 
- 
-There is an experimental git-svn bootstrap for quickly getting a complete git-svn enabled repository of your own. 
- 
-Visit https://github.com/idaemons/freebsd and follow the instructions described in the README file. 
  
 ====== FAQ ====== ====== FAQ ======
  
-  * I want authornames! Good for you, and this has been done but abandoned again for various reasons: There's no authoritative, complete and //stable// mapping of svn users to "Name %%<%%email>" pairs. Especially for people without access to freefall. Random contributors are more likely to have a conversion using the current parameters.+  * I want authornames! Use the .gitauthors file in the root of the ports tree.
   * Why the full history and not only since day X It would make the history incompatible with other people's repository and the space savings are simply not worth the hassle. As of Oct/2012, all revisions make up about 933MB.   * Why the full history and not only since day X It would make the history incompatible with other people's repository and the space savings are simply not worth the hassle. As of Oct/2012, all revisions make up about 933MB.
  
Line 95: Line 111:
  
   * SVN merges for single revisions (that span only parts of the tree then), are not really representable as merges in git and instead are called cherry-picks there. The converter tries to be smart about whole tree merges however -- this heuristic is only activated for the head/, user/, and projects/ branches. A whole-tree merge of project/foo into head/ should thus be correctly represented in git. Merges from head/ to stable/ or from contrib/ to head/ will be plain commits, i.e. "cherry-picks".   * SVN merges for single revisions (that span only parts of the tree then), are not really representable as merges in git and instead are called cherry-picks there. The converter tries to be smart about whole tree merges however -- this heuristic is only activated for the head/, user/, and projects/ branches. A whole-tree merge of project/foo into head/ should thus be correctly represented in git. Merges from head/ to stable/ or from contrib/ to head/ will be plain commits, i.e. "cherry-picks".
 +
 +===== September 2019 notes/commits force push =====
 +
 +Sometime around September 2019, refs/notes/commits was force-pushed, breaking fast-forward fetch.  If you had a copy of notes before this, ''%%git fetch%%'' won't automatically update notes do to this change.  To force reset your local copy to the new copy, use:
 +
 +<code>
 +$ git fetch -f <freebsd> refs/notes/commits:refs/notes/<commits_note_name>
 +</code>
 +
 +Where ''%%freebsd%%'' is the name of your %%FreeBSD%% Git remote (if you're not sure, try ''%%origin%%'').  Here, ''%%commits_note_name%%'' is the name of your local copy of %%FreeBSD%% ''%%refs/notes/commits%%'' (if you followed the procedure in this wiki page, try ''%%commits%%'').
  
 ====== Verification ====== ====== Verification ======
Line 154: Line 180:
  
 See the project branch at [[http://svn.freebsd.org/base/user/uqs/git_conv/]] for extra patches, rules and the scripts used to do these conversions. See the project branch at [[http://svn.freebsd.org/base/user/uqs/git_conv/]] for extra patches, rules and the scripts used to do these conversions.
 +
 +----
 +
 +{{tag>HowTo}}
  
  • gitworkflow.1446265343.txt.gz
  • Last modified: 2015/10/31 04:22
  • by KubilayKocak