Version 14 (modified by 14 years ago) (diff) | ,
---|
Using git with MythTV
You will need to create a github account, and link your @mythtv.org email address to it (if a MythTV developer). If you aren't a part of the development team, you can still create a github account and fork the repository into your account, giving pull requests later to get your changes incorporated.
For development with a github account, clone the repository with:
git clone git@github.com:MythTV/mythtv.git
For read-only access, use:
git clone git://github.com/MythTV/mythtv.git
configuring git
If this is the only git repo you are using:
git config --global user.name "Your Name" git config --global user.email you@example.com
If you do already have other repos going, you will be better off using (from the mythtv checked-out directory):
cd /path/to/mythtv-git/ git config user.name "Your Name" git config user.email you@example.com
Please use your real name and a real email address. If you are on the MythTV development team, please use the assigned canonical @mythtv.org email address. This will be attached to each commit you make, and is needed for legality reasons (i.e. to clearly denote the contributors, which can be a life-saver if we have licensing issues later)
The default git push behaviour is inconvenient or dangerous. Without options it will push all matching branches (branches with the same name in the remote and local repository).
git config --local --add push.default nothing git config --local --add push.default tracking
The first prevents any unwanted changes. tracking pushes the current branch to it's remote tracking branch. That's useful if local branches don't have exactly the same name as the remote branch. mythtv-rec vs. dkristjansson/mythtv-rec for example.
git push -n should always verified before real pushing.
git for svn users
https://git.wiki.kernel.org/index.php/GitSvnCrashCourse
https://git.wiki.kernel.org/images-git/7/78/Git-svn-cheatsheet.pdf
svn command | git command | comments |
---|---|---|
svn checkout | git clone | |
svn diff | git diff | pretty much identical |
svn stat | git status | |
svn commit | git commit / git push | in git, git commit commits locally, git push pushes to the upstream repo. Additionally, changes must be staged before committing. |
---- | git add -i / git add -p | stage commits |
svn update | git pull | technically, this is two steps combined (git fetch, git merge) git pull --rebase does a rebase instead of a merge |
svn update (to recover a single file) | git checkout HEAD filename | |
svn update (to recover all deleted files) | git ls-files -d | xargs git checkout -- | |
svn copy (to create a branch) | git branch (or git checkout -b) | |
svn copy (to create a tag) | git tag -a | |
svn switch | git checkout branch | |
svn merge | git merge | |
svn revert | git checkout or git reset | specify a filename or a directory path for recursive updates |
svn revert (for pristine index and working copy) | git reset --hard | applies to entire tree so no filename or directory allowed |
Also, github has a wealth of good information.