[Pki-devel] git push

Adam Young ayoung at redhat.com
Thu Jan 19 20:45:51 UTC 2012


On 01/19/2012 02:03 PM, Christina wrote:
> forgive me as this is my first checkin using git.  Something 
> unexpected happened.
>
> I was on the master branch and when ready I did "git push" and it 
> unexpectedly told me the following:
> Counting objects: 50, done.
> Delta compression using up to 4 threads.
> Compressing objects: 100% (23/23), done.
> Writing objects: 100% (28/28), 2.89 KiB, done.
> Total 28 (delta 19), reused 0 (delta 0)
> To ssh://git.fedorahosted.org/git/pki.git
>    5bf257b..5314d04  DOGTAG_9_BRANCH -> DOGTAG_9_BRANCH
>
> I did happen to have worked on DOGTAG_9_BRANCH as well but I did not 
> expect it to be pushed as I was on the master at the time, although I 
> was getting it ready as well.  I just did not expect it to be pushed.
>
> So does git push push everything even though you are not on that 
> branch at the moment?
> Now I see something called Merge branch 'DOGTAG_9_BRANCH' of 
> ssh://git.fedorahoste.. 
> <http://git.fedorahosted.org/git?p=pki.git;a=commit;h=5314d049fadd54666dbdae7444b8134f8b98cba0> 
> being pushed onto DOGTAG_9_BRANCH.  Is it supposed to be?


I find it essential to control exactly which branch I push from and to.  
So what you want to do is

git push <remote> <localbranch>:<remotebranch>

Git push with no arguments...I have nevere done that so I can't say,  
but I suspect it pushes for each of you local tracking branches, so it 
depends on how you made the branch in the first place.


What you want to do on DOGTAG_9_BRANCH  is create a revert commit,  that 
undoes the last commit,  and then push that to the
DOGTAG_9_BRANCH.


There is some discussion about merges versus rebases,  but I think the 
teams (IPA,  DS and now CS)  all want to go with the rebase approach.  
So before you push changes  to DOGTAG_9_BRANCH  you should do

git checkout DOGTAG_9_BRANCH
git fetch
git rebase DOGTAG_9_BRANCH

I like doing it as specific steps as I understand what each step is doing.

checkout makes sure I am in the right local branch.
git fetch pulls the changes down from the central repo to my local repo 
but makes *NO* changes to my local branch
git rebase only makes the changes, and will warn if there are any 
errors.  ONce that is done,  you will be able to push using

push origin DOGTAG_9_BRANCH:DOGTAG_9_BRANCH


You probably shouldn't be pushing to master,  unless you are working 
with Ade and Endi on some issue.





>
> thanks,
> Christina
>
>
>
> _______________________________________________
> Pki-devel mailing list
> Pki-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/pki-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/pki-devel/attachments/20120119/245becf9/attachment.htm>


More information about the Pki-devel mailing list