cse-300 - git and bitbucket user manual

Upload: phong-viet-cao

Post on 02-Jun-2018

233 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    1/35

    How to collaborate on Bitbucket.org

    using Gitby Phong Cao (ID: 108512924)

    Contents at a Glance

    Contents at a Glance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    1. Create a Btb!c"et #$ca%e&c' $cco!nt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    2. Donloa% an% Install Gt or *n%os an%+or ,ac -/ . . . . . . . . . . . . . . . . . . . . . . . 2

    . rstt&e set!3 or Gt. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    4. Generate ey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

    5. ,a"e Gt Bash re&e&ber ey. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    6. $%% ey to Btb!c"et . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

    7. or" a 3roect to yo!r Btb!c"et acco!nt . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    8. !bscrbe to a Btb!c"et re3ostory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    9. Grant or" re3ostory access to tea& &e&bers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    10. Clone a or" to local co&3!ter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

    11. 3%ate $%% an% Delete ;e&otes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

    12. Gt Co&&t < Gt P!sh Co&&an%s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    1. Gt branch co&&an%s . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

    14. 3%ate (ynchron=e) local or" th the orgnal re3ostory. . . . . . . . . . . . . . . . . . . 0

    15. Create a P!ll ;e>!est. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

    16. (or $%&nstrators) ,erge the P!ll ;e>!ests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    17. ;eerences. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    1

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    2/35

    1. Create a Bitbucket Academic Account:

    1.1.I yo! ha?en@t ha% a Btb!c"et acco!nt yet 3lease go to htt3s:++btb!c"et.org+an%

    regster or one th yo!r e&al a%%ress.

    2. Download and Install Git or !indows and"or #ac $%&:

    2.1.Go to the ollong ln" to %onloa% Gt co&&an%lne set!3 or both *n%os an%

    ,ac: htt3:++gtsc&.co&+%onloa%s

    2.2.or b!nt! an% e%ora yo! can nstall Gt thro!gh ss!ng 3lator&s3ecc nstallco&&an%s:

    A s!%o a3tget nstall gt or b!nt! $3tt!%e %eb 3ac"ages

    A s!%o y!& nstall gt or e%ora , r3& 3ac"ages

    -ther n!E an% FI/ %strb!tons ollo s&lar 3roce%!res.

    2.'.hs ser ,an!al ll &ostly 3resent eEa&3les an% screenshots o Gt

    co&&an%lne b!t the ste3s sho!l% a33ly s&larly n IDHe&be%%e% Gt. h!s yo!

    %on@t ha?e to !se an IDH (see the reasons abo?e) 3lease 3lease 3lease !se Gt

    co&&an%lne to &a"e ths &an!al easer to !n%erstan% an% learn nterestng Gt st!s.

    '. (irst)time set)u* or Git:

    '.1.-3en yo!r co&&an%lne Gt an% set yo!r Gt 3!blc %entty or easer collaboraton

    an% %entcaton as ollo:

    A gt cong global !ser.na&e #rst Fa&eJ ast Fa&eJ'

    A gt cong global !ser.e&al #o!r H&al $%%ressJ'

    2

    https://bitbucket.org/http://git-scm.com/downloadshttps://bitbucket.org/http://git-scm.com/downloads
  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    3/35

    '.2.By %ea!lt Gt lets yo! ty3e n yo!r co&&t &essage !sng the syste&@s co&&an%

    lne. oe?er yo! can set Gt to !se a %erent e%tor or yo!r co&&t &essage:

    A gt cong global core.e%tor o!r eEt H%tor o ChoceJ

    '.'.I yo! ant to chec" all o yo!r Gt settngs ss!e the ollong co&&an%:

    A gt cong lst

    -r the ollong co&&an% yo! !st ant to chec" or a 3artc!lar settng:

    A gt cong ettng@s Fa&eJ

    +. Generate %%H ,e-:

    +.1.Chec" yo! ha?e eEstng %ea!lt I%entty:

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    4/35

    +.1.a.-3en Gt (or Gt Bash on *n%os)

    +.1.b.Hnter the ollong co&&an% to ?ery the clent s a?alable:

    A ssh ?

    I yo! are !sng Gt Bash (*n%os) or ha?e ssh nstalle% (,ac -/) yo! sho!l% see

    the ollong o!t3!t:

    +.1.c.Fo that yo! ha?e ssh nstalle% enter the ollong co&&an%s to chec" yo!

    alrea%y ha?e an "ey:

    A ls a K+.ssh

    I yo! ha?e not !se% on Gt Bash or er&nal yo! ll see so&ethng l"e ths:

    I yo! ha?e alrea%y ha% a %ea!lt %entty yo! ll see to %LM les ("3 &&e%ately to

    te3 5):

    he content o the %Lrsa.3!b le s hat e are ater.

    4

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    5/35

    +.1.d.I yo! ha?en@t yet ha% the ey les ss!e the ollong co&&an% to create

    the&:

    A ssh"eygen

    I t as"s #Hnter le n hch to sa?e the "ey: ' an% #Hnter 3ass3hrase: ' an% #Hnter sa&e

    3ass3hrase agan: ' !st lea?e the& blan" an% 3ress HnterJ. he nal o!t3!t sho!l%

    loo" l"e ths:

    $ter ths ss!e the co&&an% n Part (c) abo?e to &a"e s!re that the ey has been

    generate%:

    A ls a K+.ssh

    hch sho!l% sho the ollong o!t3!t:

    5

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    6/35

    . #ake Git Bas/ remember %%H ,e-:

    .1.se yo!r a?orte teEt e%tor e%t an eEstng (or create a ne) le calle% #cong'

    !n%er K+.ssh ol%er (or n other or% e%t or create a ne K+.ssh+cong le) th the

    ollong content:

    ost btb!c"et.org

    I%enttyle K+.ssh+%Lrsa

    hs cong le s s&lar to the o3ton #;e&e&ber &e' or #;e&e&ber &y serna&e an%

    Passor%' hen yo! logn nto $&a=on or Google. It hel3s yo! not ha?ng to enter the

    hole ey anyt&e yo! 3!sh yo!r st!s to Btb!c"et.org.

    F-H: he sngle s3ace n the 2n% lne s NH; &3ortantO o! ha?e to n%ent eEactly 1

    s3ace or Gt Bash on@t be able to re&e&ber yo!r ey.

    .2.a?e an% close the le.

    .'.;estart yo!r Gt Bash ter&nal

    0. Add %%H ,e- to Bitbucket:

    0.1.ro& the to3 rght corner o Btb!c"et go to ,anage $cco!nt hch %s3lay the

    $cco!nt ettngs 3age.

    6

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    7/35

    0.2.In the $cco!nt ettngs 3age clc" on # "eys' on the let s%ebar hch ta"es

    yo! to the eys 3age. Fo clc" on #$%% ey' to a%% yo!r ey to Btb!c"et:

    0.'.$ %alog ll a33ear lettng yo! a%% the "ey. &3ly enter a na&e or the "ey n the

    #abel' teEtboE an% 3aste the hole content o K+.ssh+%Lrsa.3!b le nto the #ey'

    teEtarea (the eEtenson M.3!b n%cates that ths le contans ey or regsterng on

    3!blc stes < re3os l"e Btb!c"et. he %Lrsa le on the other han% only res3onsble or

    loggngn hen yo! %o a Gt 3!sh):

    7

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    8/35

    0.+.nally clc" #$%%' to a%% the ey nto yo!r Btb!c"et acco!nt.

    . (ork a *roect to -our Bitbucket account:

    .1.ro& the to3 Btb!c"et na?gaton bar clc" on ea& J ea&LFa&eJ. hs llbrng yo! to the Btb!c"et 3age or ea&LFa&eJ ea&:

    .2. Fo clc" on the ; or ProectLFa&eJ 3roect hch o!l% lea% yo! to the

    ProectLFa&eJ 3roect &an 3age:

    8

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    9/35

    .'.-n the ProectLFa&eJ 3roect ho&e3age clc" on #HE3an% %ebar' at the botto&

    to eE3an% the Btb!c"et %ebar:

    .+.-n the eE3an%e% Btb!c"et %ebar yo!@ll see an o3ton calle% #or"'. Clc" on that

    #or"' ln" ll lea% yo! to the #or"' settngs 3age here yo! can set o3tons or yo!r

    or":

    9

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    10/35

    ..$ter the #or"' settngs 3age s %s3laye% enter the nor&aton as belo an% clc"

    #or" ;e3ostory' to or" the orgnal ProectLFa&eJ re3o to yo!r Btb!c"et acco!nt:

    10

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    11/35

    .0.$ter ths ste3 go bac" to yo!r ho&e3age. o! sho!l% see a 3roect calle%

    #yo!rLBtb!c"etL!serna&eJ+ProectLFa&eJ' !n%er yo!r Btb!c"et ho&e3age. Clc"

    on that 3roect ln" to get to the -?er?e 3age o yo!r ProectLFa&eJ or":

    .. *hen yo!@re at the -?er?e 3age o yo!r ProectLFa&eJ or" yo! ll see a lne

    calle% #or" o' hch n%cates the orgnal re3ostory that ths ProectLFa&eJ or"

    belongs to an% on the to3rght o the screen yo! ll see an ln" that yo! ll (later)

    !se to clone the or" to yo!r local co&3!ter an% !3%ate t as changes are &a%e to the

    orgnal re3o:

    .3.Fo as yo!@re %one th the or"ng o ProectLFa&eJ to yo!r Btb!c"et acco!nt

    co3y the ln" (shon n the abo?e screenshot) an% &o?e on to the neEt ste3O

    3. %ubscribe to a Bitbucket re*ositor-:

    11

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    12/35

    3.1.ro& the to3 Btb!c"et na?gaton bar go to the Btb!c"et 3age or ea&LFa&eJ

    ea& an% then ProectLFa&eJ 3roect re3ostory:

    3.2.*hen yo!@re at the Btb!c"et 3age o the ProectLFa&eJ re3ostory clc" on the

    #Don' arro neEt to the #*atch' b!tton on the to3 rght o the 3roect Btb!c"et 3age.

    Chec" all the chec"boEes so that yo! can atch or all the changes (*" P!sh P!ll

    etc.) o the 3roect:

    12

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    13/35

    3.'.Fo go to yo!r (or") ProectLFa&eJ re3ostory on Btb!c"et an% re3eat the 2

    ste3s abo?e. hs s ?ery &3ortant beca!se t lets yo! "no n case there s any tea&

    &e&ber that or"s yo!r ProectLFa&eJ or" re3ostory.

    4. Grant ork re*ositor- access to team members

    4.1. ro& the Btb!c"et na?gaton bar go to yo!r Btb!c"et acco!nt ho&e3age an% then

    yo!r ProectLFa&eJ or" re3ostory@s -?er?e 3age:

    4.2.-n yo!r ProectLFa&eJ or" re3ostory -?er?e 3age eE3an% the let s%ebar.

    Clc" on the te& calle% #ettngs' to access the settngs o yo!r ProectLFa&eJ or"

    re3ostory:

    4.'.-n yo!r ProectLFa&eJ or" re3ostory settngs 3age clc" on #$ccess

    ,anage&ent' to access the $ccess ,anage&ent 3age:

    1

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    14/35

    4.+. *hen yo!@re on the $ccess ,anage&ent 3age clc" on the %ro3%on &en! n the

    #Gro!3s' secton an% choose #$%&nstrators (tea&Lna&eJ:a%&nstrators)' then clc"

    #$%%'. Do the sa&e or #De?elo3ers (tea&Lna&eJ:%e?elo3ers)' gro!3 n the %ro3%on&en!. he nal res!lt s n the secon% screenshot ollong:

    14

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    15/35

    15. Clone a ork to local com*uter

    15.1.Fo that yo! ha?e co3e% the ln" o3en Gt Bash an% ss!e the ollong

    co&&an%:

    A gt clone gtbtb!c"et.org:yo!rLBtb!c"etL!serna&eJ+ProectLFa&eJ.gt

    K+ProectLFa&eJ

    hs co&&an% ll clone (or %onloa% n other or%s) the ProectLFa&eJ or" ro&

    yo!r acco!nt to a ol%er calle% #ProectLFa&eJ' !n%er yo!r ho&e ol%er.

    Q I yo!@re !sng *n%os the 3ath to ol%er s

    C:RsersRyo!rL*n%osL!serna&eJRProectLFa&eJ.

    Q I yo!@re !sng ,ac -/ or n!E the 3ath to ol%er s

    +ho&e+yo!rL!serna&eJ+ProectLFa&eJ or s&3ly K+ProectLFa&eJ.

    15

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    16/35

    15.2.$ter the clonng 3rocess s nshe% yo! can chec" to see the Gt re&ote re3o o

    yo!r local ProectLFa&eJ &atch th the ln" o the ProectLFa&eJ or" on yo!r

    Btb!c"et acco!nt by #c%ng' nto the 3roect@s ol%er (hch &eans gettng ns%e the3roect ol%er !sng the co&&an%lne) an% ss!ng the ollong co&&an%:

    A gt re&ote ?

    15.'.o n the abo?e screenshot I got &y re&ote a%%resses correctly. he re&otes by

    %ea!lt are calle% #orgn' an% ther a%%resses sho!l% &atch the a%%resses o yo!r

    ProectLFa&eJ or".

    $s yo! can see ater the ; o each re&ote there s a 3arentheses n%cates hat

    "n% o re&ote t s. In ths case #(etch)' re&ote &eans that hen yo! %o a Gt 3!ll an%

    a Gt etch (yo!@ll see t later) the so!rce co%e ll be #etche%' ro& ths ; to yo!r

    local co&3!ter. *hen yo! %o a Gt 3!sh (hch &eans !3loa%ng yo!r co%e to yo!r

    Btb!c"et ProectLFa&eJ or") the #(3!sh)' re&ote@s ; ll be here yo!r co%e s

    gonna get !3loa%e%.

    11. 6*date7 Add and Delete 8emotes

    11.1.In or%er to !3%ate the ; o a Gt ;e&ote ss!e the ollong co&&an%:

    A gt re&ote set!rl re&oteLna&eJ neLre&oteL!rlJ

    16

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    17/35

    $s yo! can see n the abo?e screenshot I change% the ; o the #orgn' re&ote ro&

    gtbtb!c"et.org:3hong?cao+ProectLFa&eJ.gt to 3hong?cao.co&

    11.2.In or%er to !3%ate the Fa&e o a Gt ;e&ote ss!e the ollong co&&an%:

    A gt re&ote rena&e ol%Lre&oteLna&eJ neLre&oteLna&eJ

    $s yo! can see n the abo?e screenshot I change% &y #orgn' re&ote@s na&e ro&

    #orgn' to #3hong?cao'.

    11.'.In or%er to a%% a re&ote ss!e the ollong co&&an%:

    A gt re&ote a%% re&oteLna&eJ re&oteL!rlJ

    17

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    18/35

    $s yo! can see n the abo?e screenshot I a%%e% a re&ote na&e% #orgn'

    (gtbtb!c"et.org:3hong?cao+ProectLFa&eJ.gt) nto &y ProectLFa&eJ@s Gt re3o.

    11.+.In or%er to re&o?e a re&ote ss!e the ollong co&&an%:

    A gt re&ote re&o?e re&oteLna&eJ

    $s yo! can see n the abo?e screenshot I re&o?e% the re&ote na&e% #3hong?cao'

    hle "ee3ng the #orgn' re&ote.

    12: Git Commit 9 Git us/ Commands

    F-H: Beore beng able to a33ly any o these co&&an%s yo! &!st rst ss!e #c%' nto

    the 3roect ol%er (or gettng ns%e the 3roect ol%er !sng co&&an%lne) or any o ts

    s!bol%er !sng the ollong co&&an%:

    A c% 3ath+to+3roect+ol%erJ

    18

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    19/35

    12.1.$%% a change% le to a #Gt co&&t':

    A gt a%% 3ath+to+leJ

    12.2.;e&o?e a le (or a ol%er an% all o ts s!bol%er) ro& a #Gt co&&t' (tho!t%eletng t ro& the local lesyste&):

    A gt r& r cache% 3ath+to+le+or+ol%erJ

    $s yo! can see n the abo?e screenshot the le ICHFH as re&o?e% ro& the #Gtco&&t' recor% yet stll eEstng n the local le syste&.

    12.'.;e&o?e a le (or a ol%er an% all o ts s!bol%er) ro& a #Gt co&&t' (an% also

    %elete t ro& the local lesyste&):

    A gt r& r 3ath+to+le+or+ol%erJ

    19

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    20/35

    $s yo! can see ro& the abo?e screenshot &y %eleton o the ICHFH le as

    !ns!ccess!l beca!se the ICHFH le as %elete% ro& the #Gt co&&t' recor% n the

    3re?o!s ste3.

    12.+.$%% all les n the c!rrent 3roect ol%er (or s!bol%er hate?er ol%er yo!r

    co&&an%lne clent s c!rrently at) to a #Gt co&&t' (b!t stll "ee3 the %elete% les):

    A gt a%% M

    12..$%% all les n the c!rrent 3roect ol%er (or s!bol%er hate?er ol%er yo!r

    co&&an%lne clent s c!rrently at) to a #Gt co&&t' (b!t recor% the %elete% les):

    A gt a%% $

    12.0.Create a #Gt co&&t':

    A gt co&&t & #y3e yo!r co&&t &essage here'

    20

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    21/35

    he co&&t &essage ty3cally contans the lst o all o the changes yo! &a%e n yo!r

    3roect an% hat s stll let to %o.

    o enter a nelne l"e n the abo?e screenshot yo! ha?e to 3ress htJHnterJ.

    12..P!sh the #Gt co&&t' to Btb!c"et:

    A gt 3!sh orgn &aster

    12.3.st all the #Gt co&&ts' that yo! &a%e:

    A gt log

    he trngs hghlghte% n ello are the ash Co%es o the co&&ts.

    he #Gt co&&ts' lste% by #gt log' are sorte% n re?erse% chronologcal or%er th the

    latest an% &ost recent #Gt co&&t' on to3 an% the ol%est one at the botto&.

    12.4.Ne the c!rrent #Gt co&&t' that yo! are at:

    21

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    22/35

    A gt log n 1

    12.15.tch beteen #Gt co&&t's:

    A gt reset har% theLrstL6LlettersLoLtheLGtLco&&t@sLashLCo%eJ

    22

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    23/35

    $s yo! can see n the abo?e screenshot I stche% ro& &y c!rrent #Gt co&&t' hch

    s #0511%' to the rst ntal #Gt co&&t' hch s #a%'.

    12.11.H%t a #Gt co&&t' &essage (n an eEternal e%tor):

    A gt co&&t a&en%

    2

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    24/35

    Fote: Beore ss!ng ths co&&an% &a"e s!re that the core.e%tor ?arable o yo!r Gt

    global settngs has been set to yo!r a?orte teEt e%tor (see te3 .2 abo?e) by ss!ngthe ollong co&&an%:

    A gt cong core.e%tor

    24

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    25/35

    I yo!r #Gt co&&t' global e%tor s not yet set yo! can set t !sng the ollong

    co&&an% (&entone% n te3 .2):

    A gt cong global core.e%tor o!r eEt H%tor o ChoceJ

    12.12.;e3lace a #Gt co&&t' &essage:

    A gt co&&t a&en% & #Fe Co&&t ,essageJ'

    1'. Git branc/ commands

    Fo that yo!@?e learne% abo!t Gt branches !n%a&entals let@s loo" at the concrete

    eEa&3les an% co&&an%s !se% to &an3!late Gt branches.

    1'.1.st all Gt branches:

    A gt branch ?

    25

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    26/35

    he branch &ar"e% th the M character s yo!r c!rrent branch

    1'.2.Create a ne Gt branch:

    A gt branch neBranchFa&eLa!thorBtb!c"etserna&eJ

    $s yo! can see n the abo?e screenshot the #neLeat!re1' branch has been

    s!ccess!lly create%.

    $s a con?enton hen yo! create a ne branch 3lease n%cates yo!r Btb!c"et

    !serna&e n the na&e o the branch se3arate% by !n%erscore #L' so e "no ho s

    &anly res3onsble or or"ng on ths 3artc!lar branch.

    $lso note that hen yo! create a ne Gt branch yo!r Gt H$D 3onter s stll 3ontng

    to the branch yo!@re c!rrently at. o! ha?e to eE3lctly ss!e a Gt stch (#Gt chec"o!t')

    co&&an% to stch to the ne Gt branch yo! !st create%.

    1'.'.tch to another Gt branch:

    A gt chec"o!t branchLna&eJ

    26

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    27/35

    $s yo! can see n the abo?e screenshot the M character rst hghlghte% the #&aster'

    branch. hen ater the co&&an% s ss!e the M character hghlghte% the #neLeat!re1'

    branch.

    1'.+.Create an% stch to a ne Gt branch (at once):

    A gt chec"o!t b neLbranchLna&eJ

    $s yo! can see n the abo?e screenshot the M character rst hghlghte% the

    #neLeat!re1' branch. hen ater the co&&an% s ss!e the M character hghlghte% the

    nelycreate% #neLeat!re2' branch.

    1'..,erge yo!r Gt branch th another branch:

    In or%er to &erge yo!r c!rrent Gt branch to another branch (or eEa&3le the #&aster'

    branch) yo! ha?e to rst stch to the branch that s &ore #stable' !sng #gt chec"o!t'.hen yo! can ss!e the ollong co&&an% to &erge yo!r c!rrent &orestable branch to

    another lessstable branch:

    A gt chec"o!t &oreLstableLbranchJ

    27

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    28/35

    A gt &erge lessLstableLbranchJ

    $s yo! can see n the abo?e screenshot I rst chec"o!t the #&aster' branch hch s

    &ore stable than #neLeat!re1'. $ter that I &erge the #&aster' branch th the

    #neLeat!re1' branch.

    1'.0.st all Gt branches that *H;H &erge% to yo!r c!rrent branch:

    A gt branch &erge%

    1'..st all Gt branches that *H;H F- &erge% to yo!r c!rrent branch:

    A gt branch no&erge%

    28

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    29/35

    1'.3.Delete a local Gt branch

    A gt branch % branchLna&eJ

    $ter ths co&&an% s eEec!te% the branch branchLna&eJ s %elete% ro& the local

    re3ostory on yo!r co&3!ter. oe?er yo!@?e alrea%y 3!she% ths branchLna&eJ to

    Btb!c"et the branch branchLna&eJ stll eEsts onlne on Btb!c"et.

    1'.4. P!sh a local Gt branch to Btb!c"et:

    o 3!sh a local branch to Btb!c"et ss!e the ollong co&&an%:

    A gt 3!sh re&oteLna&eJ branchLna&eJ

    1'.15.Delete a re&ote Gt branch:

    29

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    30/35

    $s yo! can see n the 3rece%ng secton the #gt branch %' co&&an% only %eletes the

    local branchLna&eJ branch on yo!r co&3!ter. *hen yo! %o a #Gt co&&t' agan an%

    ss!e a #Gt 3!sh' the re&ote branchLna&eJ branch hoste% on Btb!c"et ll not get

    %elete%. o also %elete the re&ote branchLna&eJ branch ss!e the ollong

    co&&an%:

    A gt 3!sh %elete branchLna&eJ

    1+. 6*date ;%-nc/roni

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    31/35

    $s yo! can see n the abo?e screenshot I na&e the ocal MMorgnalMM ProectLFa&eJ

    re&ote #&an' (so bascally I re3lace% aLna&eLorLProectLFa&eJLorgnalLre&oteJ

    th #&an' an% orgnalLProectLFa&eJLre&oteL!rlJ th

    gtbtb!c"et.org:ea&LFa&eJ+ProectLFa&eJ.gt hch s the ; to the ocal

    MMorgnalMM ProectLFa&eJ re&ote on Btb!c"et.

    $ter ths yo! can %o a #A gt 3!sh orgn &aster' nor&ally to 3!sh yo!r nely!3%ate%

    local ProectLFa&eJ or" to the ProectLFa&eJ or" re3ostory on yo!r Btb!c"et

    acco!nt.

    1. Create a ull 8e>uest

    1.1.$ter yo!@?e conr&e% the stablty o the changes yo! &a%e hea% o?er to yo!rBtb!c"et acco!nt an% go to the ho&e3age o yo!r ProectLFa&eJ or" re3ostory:

    1.2.$ter gettng nto yo!r ProectLFa&eJ or" re3ostory on Btb!c"et eE3an% the

    Btb!c"et@s let %ebar (see te3 7.2). Clc" on the o3ton calle% #Create a P!ll

    ;e>!est' hch ll lea% yo! to the #Create P!ll ;e>!est' 3age:

    1.'. -n the #Create a P!ll ;e>!est' 3age &a"e s!re that the Gt branches an% Gt

    re3ostores nor&aton are correct (&eanng they are hat yo! ant to &erge):

    1

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    32/35

    *hen yo!@re %one re?eng clc" on #Create 3!ll re>!est' b!tton to start the P!llng

    3rocess ro& the tea& &e&ber@s ProectLFa&eJ or" re3ostory to the ocal

    MMorgnalMM ProectLFa&eJ re3ostory.

    10. ;(or Administrators= #erge t/e ull 8e>uests

    10.1. Clc" on the #P!ll ;e>!est' secton on the let s%ebar o Btb!c"et hch lea%s to a3age shong all recent P!ll ;e>!est create% by tea& &e&bers.

    2

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    33/35

    10.2.Clc" on a P!ll ;e>!est. H%t anythng nee%e% an% hen yo!@re %one 3lease

    clc" on #$33ro?e' an% then #,erge' to start the ,ergng 3rocess:

    10.'.Fo yo!@ll be 3resente% a ,erge %alog. S!st clc" on #,erge' to nsh the ,ergng

    3rocess:

    10.+.o!@re no nshe%O he tea& &e&ber@s ProectLFa&eJ or" re3ostory has

    been s!ccess!lly &erge% to the ocal MMorgnalMM ProectLFa&eJ re3o on Btb!c"et.

    o! sho!l% no noty other tea& &e&bers abo!t the ,erge so they "no to !3%ate

    ther local ProectLFa&eJ or" re3ostores accor%ngly (see te3 14):

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    34/35

    4

  • 8/10/2019 CSE-300 - Git and Bitbucket User Manual

    35/35

    1. 8eerences

    1. TBtb!c"et Doc!&entaton.TAtlassian Documentation. $tlanssan 9 San. 2014. *eb.

    1 -ct. 2014. htt3s:++conl!ence.atlassan.co&+%s3lay+BIBCH+Btb!c"et

    Doc!&entaton o&eJ.

    2. Chacon cott. Pro Git. 1st e%. $3ress 2009. 1288. Prnt.