create new tag
view all tags


git installation

 copy epel.repo to /etc/yum.repos.d/
yum search git-svn
yum install git-svn 
     >GPG key retrieval failed:。。。。 No such file or directory: '/etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL'
cd /etc/pki/rpm-gpg/
wget http://download.fedora.redhat.com/pub/epel/RPM-GPG-KEY-EPEL
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL
yum install git-svn
    > Complete!

Checkout the project

git clone git@github.com:vkuznet/PyQueryBuilder.git

Review modification

git status

Add file/dictionary

git add README

Commit modification

git commit -a -m "YOUR COMMENT"

push modification to remote branch

git push origin master

Patch management on client with stg

Checkout the project

git clone git@github.com:vkuznet/PyQueryBuilder.git

#Configure remotes
#When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo it was forked from. 
#To keep track of the original repo, you need to add another remote named upstream:

git remote add upstream git@github.com:vkuznet/PyQueryBuilder.git
git fetch upstream
git merge upstream/master

Initialise Stacked Git in the cloned git repository.

stg init

Start developing patches in local 'mydev' against 'remotes/trunk'.

# Create stg and git branch.
stg branch -c mydev

# Start a new patch called improve-layout that fixes the problem in ticket 123
stg new -m "Improve layout of sites page, fixes #123" improve-layout
vi src/templates/SiteDB/sitelist.tmpl # Make changes to the necessary files
stg refresh             # Add those changes into your current patch
stg show                # Show the changes you have made in the current patch
stg series -a -d        # Show the patch series in your stack
# edit patch comment (stg edit), add new patches etc. etc.

touch my_new_file       # Create a new file
git add my_new_file     # Add the file to git
stg refresh             # Add that change into your current patch

stg show                # Review patch, should include new files too

send out a patch

stg mail 
# to local filesystem
stg export -d ~/ -n -p patch_name

Once your patch has been accepted and committed you will need to bring your private repository up to the SVN head and clean out your old patches. This is done by issuing

stg commit
stg branch master
stg branch --delete mydev
stg branch -c mydev

stg pull -m # Bring code up to SVN head
stg clean # Clear out the local copy of your, now committed, patches

Patch management on master with git

apply a patch via git

git apply --check patch_name
git apply patch_name

git am --signoff < fix_empty_poster.patch 

# review patches and then commit
git status
git commit -a

update github

 git push origin master

git undo and redo

 git commit ... 
git reset --soft HEAD^ 
git commit -a -c ORIG_HEAD 

-- LiangDong - 2011-02-01

Edit | Attach | Watch | Print version | History: r7 < r6 < r5 < r4 < r3 | Backlinks | Raw View | Raw edit | More topic actions
Topic revision: r7 - 2012-08-24 - LiangDong
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2023 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback