[Open-scap] patch help guide

Peter Vrabec pvrabec at redhat.com
Thu Mar 19 15:13:43 UTC 2009


Hi folks,

there are some instructions that might be helpful to pass over git :)
This supposed to be just a survival guide for patch creation. If you find it 
useful, we can place it on open-scap.org. 

HERE WE GO

#get sources
$git clone git://git.et.redhat.com/openscap.git

#set your name and email and colors
$git config --global user.name "Your Name"
$git config --global user.email "you at example.com"
$git config --global color.ui "auto"

#create new file and stage it for commit
$<<create the file newfile>>
$git add newfile

#edit file and stage it for commit
$<<edit file>>
$git add file

#remove file
$git rm oldfile

#see the changes between last commit and staged files
$git diff --cached

#see files which would be commited (by git commit)
#and files which could be commited(by git add; git commit)
$git status

#do you want to revert changes in the file that is already staged?
#unstage it first
$git reset file
#chechout the file again
$git checkout file

#we are done with work, lets commit it
$git commit -m "my first commit"

#list commits
$git log

#you don't like this commit and want to return back
$git reset --hard HEAD^

#otherwise, create a patch from the latest commit
$git-format-patch -1

#send patch to mailing list!!!

# and now something special
# what if someone else already made commits into origin(remote) 
# repository and you want to be up2date:
# get the metadata from origin
$git fetch
#what commits are in origin that are not in your local
$git log --pretty=oneline master..origin/master
#what commits are in your local that are not in origin
$git log --pretty=oneline origin/master..master
#lets download commits from origin and put out commits on top of it
$git-rebase origin/master
#and continue the work like

#how to create tarball
$./autogen.sh
$./configure
$./make dist-gzip

#clean working tree, erase untracked files
$git clean -fd


If you want to know more about git, there are many tutorials available online 
everywhere.

Peter.




More information about the Open-scap-list mailing list