Presentation is loading. Please wait.

Presentation is loading. Please wait.

Command Line Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See

Similar presentations


Presentation on theme: "Command Line Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See"— Presentation transcript:

1 Command Line Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information. Version Control

2 Command Line SmartSVN

3 Version ControlCommand Line SmartSVN Command Line

4 Version ControlCommand Line It’s fast.

5 Version ControlCommand Line It’s fast. It’s simple.

6 Version ControlCommand Line revision 6

7 Version ControlCommand Line $ svn checkout

8 Version ControlCommand Line $ svn co

9 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters

10 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters repository

11 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters working copy

12 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters Aearth/carlsbad.txt Aearth/antarctica.txt... Checked out revision 6. $ 6 6

13 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters Aearth/carlsbad.txt Aearth/antarctica.txt... Checked out revision 6. $ cd /cygwin/home/dracula/monsters $ 6

14 Version ControlCommand Line $ svn co https://universal.software-carpentry.org /cygwin/home/dracula/monsters Aearth/carlsbad.txt Aearth/antarctica.txt... Checked out revision 6. $ cd /cygwin/home/dracula/monsters $ ls earth mars jupiter … $ 6

15 Version ControlCommand Line $ svn log

16 Version ControlCommand Line $ svn log Damn the budget – the Jovian moons would be … -------------------------------------------- r6 | mummy | 2010-07-26 09:21:39 | 1 lines The budget might not even stretch to a deep… -------------------------------------------- r5 | mummy | 2010-07-26 09:19:18 | 1 lines … $ 6

17 Version ControlCommand Line $ svn log Damn the budget – the Jovian moons would be … -------------------------------------------- r6 | mummy | 2010-07-26 09:21:39 | 1 lines The budget might not even stretch to a deep… -------------------------------------------- r5 | mummy | 2010-07-26 09:19:18 | 1 lines … $ 6

18 Version ControlCommand Line $ svn log Damn the budget – the Jovian moons would be … -------------------------------------------- r6 | mummy | 2010-07-26 09:21:39 | 1 lines The budget might not even stretch to a deep… -------------------------------------------- r5 | mummy | 2010-07-26 09:19:18 | 1 lines … $ 6

19 Version ControlCommand Line $ svn log Damn the budget – the Jovian moons would be … -------------------------------------------- r6 | mummy | 2010-07-26 09:21:39 | 1 lines The budget might not even stretch to a deep… -------------------------------------------- r5 | mummy | 2010-07-26 09:19:18 | 1 lines … $ 6

20 Version ControlCommand Line $ cd jupiter $ 6

21 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ 6+

22 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ see SWC lecture on “The Shell” for details about file creation 6+

23 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ 6+

24 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ svn add 6+

25 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ svn add moons.txt 6+

26 Version ControlCommand Line $ cd jupiter $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 … $ svn add moons.txt Amoons.txt $ 6+

27 Version ControlCommand Line revision 6 revision 6+

28 Version ControlCommand Line $ svn commit –m “Some basic facts about the Galilean moons of Jupiter.” 6+

29 Version ControlCommand Line $ svn commit –m “Some basic facts about the Galilean moons of Jupiter.” 6+

30 Version ControlCommand Line $ svn commit –m “Some basic facts about the Galilean moons of Jupiter.” 6+

31 Version ControlCommand Line $ svn commit –m “Some basic facts about the Galilean moons of Jupiter.” Addingmoons.txt Transmitting file data.. Committed revision 7. $ 7 7

32 Version ControlCommand Line revision 7 revision 6

33 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters 6

34 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters $ svn update 6

35 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters $ svn update Ajupiter/moons.txt Updated to revision 7. $ 7 7

36 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters $ svn update Ajupiter/moons.txt Updated to revision 7. $ cd jupiter $ less moons.txt NameOrbital RadiusOrbital PeriodMass Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 7

37 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters $ svn update Ajupiter/moons.txt Updated to revision 7. $ cd jupiter $ less moons.txt NameOrbital RadiusOrbital PeriodMass Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Calisto1882.716.6890181075.9 7

38 Version ControlCommand Line $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Callisto1882.716.6890181075.9 7+

39 Version ControlCommand Line $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Callisto1882.716.6890181075.9 7+

40 Version ControlCommand Line $ nano moons.txt GNU Nano NameOrbital RadiusOrbital PeriodMass Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 Callisto1882.716.6890181075.9 … $ svn commit –m “1. Fixed typo Calisto->Callisto. 2. Added info about Amalthea.” Sending jupiter/moons.txt Transmitting file data. Committed revision 8. 8 8

41 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters 7

42 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff 7

43 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD 7

44 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD 7

45 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD Index: jupiter/moons.txt ================================================================= --- jupiter/moons.txt (revision 8) +++ jupiter/moons.txt (working copy) @@ -1,6 +1,5 @@ NameOrbital RadiusOrbital PeriodMass -Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 -Callisto 1882.7 16.689018 1075.9 +Calisto 1882.7 16.689018 1075.9 $ 7

46 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD Index: jupiter/moons.txt ================================================================= --- jupiter/moons.txt (revision 8) +++ jupiter/moons.txt (working copy) @@ -1,6 +1,5 @@ NameOrbital RadiusOrbital PeriodMass -Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 -Callisto 1882.7 16.689018 1075.9 +Calisto 1882.7 16.689018 1075.9 $ 7

47 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD Index: jupiter/moons.txt ================================================================= --- jupiter/moons.txt (revision 8) +++ jupiter/moons.txt (working copy) @@ -1,6 +1,5 @@ NameOrbital RadiusOrbital PeriodMass -Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 -Callisto 1882.7 16.689018 1075.9 +Calisto 1882.7 16.689018 1075.9 $ 7

48 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters $ svn diff –r HEAD Index: jupiter/moons.txt ================================================================= --- jupiter/moons.txt (revision 8) +++ jupiter/moons.txt (working copy) @@ -1,6 +1,5 @@ NameOrbital RadiusOrbital PeriodMass -Amalthea181.40.4981790.075 Io421.61.769138893.2 Europa670.93.551181480.0 Ganymede1070.47.1545531481.9 -Callisto 1882.7 16.689018 1075.9 +Calisto 1882.7 16.689018 1075.9 $ svn update G jupiter/moons.txt Updated to revision 8. 8 8

49 Version ControlCommand Line revision 8

50 Version ControlCommand Line Dealing with Conflicts

51 Version ControlCommand Line revision 8 revision 8+

52 Version ControlCommand Line revision 9 revision 8+

53 Version ControlCommand Line $ svn commit -m “Added data for Himalia, Elara" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ 8+ 9

54 Version ControlCommand Line $ svn commit -m “Added data for Himalia, Elara" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ 8+ 9

55 Version ControlCommand Line $ svn commit -m “Added data for Himalia, Elara" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ svn update G jupiter/moons.txt Updated to revision 9. $ 9+ 9

56 Version ControlCommand Line $ svn commit -m “Added data for Himalia, Elara" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ svn update G jupiter/moons.txt Updated to revision 9. $ svn commit -m “Added data for Himalia, Elara" Sending jupiter/moons.txt Transmitting file data. Committed revision 10. $ 10

57 Version ControlCommand Line revision 10 revision 9+ revision 10+

58 Version ControlCommand Line revision 11 revision 9+ revision 11

59 Version ControlCommand Line $ svn commit -m “Added measurement units" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ 9+ 11

60 Version ControlCommand Line $ svn commit -m “Added measurement units" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ svn update 9+ 11

61 Version ControlCommand Line $ svn commit -m “Added measurement units" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ svn update Conflict discovered in ‘jupiter/moons.txt'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: 9+ 11

62 Version ControlCommand Line $ svn commit -m “Added measurement units" Sending jupiter/moons.txt svn: Commit failed (details follow): svn: File or directory 'moons.txt' is out of date; try updating svn: resource out of date; try updating $ svn update Conflict discovered in ‘jupiter/moons.txt'. Select: (p) postpone, (df) diff-full, (e) edit, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: df 9+ 11

63 Version ControlCommand Line --- jupiter/.svn/text-base/moons.txt.svn-base Fri Oct 1 21:08 +++ jupiter/.svn/tmp/moons.txt.tmp Fri Oct 1 22:59 @@ -1,6 +1,11 @@ Name Orbital Radius Orbital Period Mass +<<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options:

64 Version ControlCommand Line --- jupiter/.svn/text-base/moons.txt.svn-base Fri Oct 1 21:08 +++ jupiter/.svn/tmp/moons.txt.tmp Fri Oct 1 22:59 @@ -1,6 +1,11 @@ Name Orbital Radius Orbital Period Mass +<<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options:

65 Version ControlCommand Line --- jupiter/.svn/text-base/moons.txt.svn-base Fri Oct 1 21:08 +++ jupiter/.svn/tmp/moons.txt.tmp Fri Oct 1 22:59 @@ -1,6 +1,11 @@ Name Orbital Radius Orbital Period Mass +<<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options:

66 Version ControlCommand Line --- jupiter/.svn/text-base/moons.txt.svn-base Fri Oct 1 21:08 +++ jupiter/.svn/tmp/moons.txt.tmp Fri Oct 1 22:59 @@ -1,6 +1,11 @@ Name Orbital Radius Orbital Period Mass +<<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: e

67 Version ControlCommand Line GNU Nano Name Orbital Radius Orbital Period Mass <<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 …

68 Version ControlCommand Line GNU Nano Name Orbital Radius Orbital Period Mass <<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 …

69 Version ControlCommand Line GNU Nano Name Orbital Radius Orbital Period Mass <<<<<<<.mine + * 10^3 km * days * 10^20 kg +======= + (10**3 km) (days) (10**20 kg) +>>>>>>>.r11 Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 …

70 Version ControlCommand Line GNU Nano Name Orbital Radius Orbital Period Mass * 10^3 km * days * 10^20 kg Amalthea 181.4 0.498179 0.074 Io 421.6 1.769138 893.2 Europa 670.9 3.551181 480.0 Ganymede 1070.4 7.154553 1481.9 Callisto 1882.7 16.689018 1075.9 …

71 Version ControlCommand Line Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: 9+ 11

72 Version ControlCommand Line Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: r 9+ 11

73 Version ControlCommand Line Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: r Updated to revision 11. $ 11+ 11

74 Version ControlCommand Line Select: (p) postpone, (df) diff-full, (e) edit, (r) resolved, (mc) mine-conflict, (tc) theirs-conflict, (s) show all options: r Updated to revision 11. $ svn commit -m “Added measurement units“ Sending jupiter/moons.txt Transmitting file data. Committed revision 12. 12

75 Version ControlCommand Line Rollback

76 Version ControlCommand Line revision 12

77 Version ControlCommand Line revision 12 revision 12+

78 Version ControlCommand Line revision 12 revision 12+ UNDO!

79 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters/jupiter $ 12+

80 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters/jupiter $ svn revert 12+

81 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters/jupiter $ svn revert moons.txt 12+

82 Version ControlCommand Line $ cd /cygwin/home/wolfman/monsters/jupiter $ svn revert moons.txt Reverted moons.txt $ 12

83 Version ControlCommand Line revision 12

84 Version ControlCommand Line revision 12 revision 12+

85 Version ControlCommand Line revision 13

86 Version ControlCommand Line revision 13 I want to reverse!

87 Version ControlCommand Line 13121011 NO ERASING!

88 Version ControlCommand Line 1011121314 merge

89 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge 13

90 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge -r 13

91 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge –r HEAD:12 13

92 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge –r HEAD:12 moons.txt 13

93 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge –r HEAD:12 moons.txt -- Reverse-merging r13 into ‘moons.txt’ Umoons.txt $ 13+

94 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge –r HEAD:12 moons.txt -- Reverse-merging r13 into ‘moons.txt’ Umoons.txt $ svn diff... $ 13+

95 Version ControlCommand Line $ cd /cygwin/home/dracula/monsters/jupiter $ svn merge –r HEAD:12 moons.txt -- Reverse-merging r13 into ‘moons.txt’ Umoons.txt $ svn diff... $ svn commit –m “Alright, no commas.” Sending jupiter/moons.txt Transmitting file data. Committed revision 14. 14

96 Version ControlCommand Line svn co check out repository svn log view change history svn add add file svn commit commit file svn update update to most recent revision svn diff view differences between revisions svn merge merge revisions

97 October 2010 created by Ainsley Lawson Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See http://software-carpentry.org/license.html for more information.


Download ppt "Command Line Copyright © Software Carpentry 2010 This work is licensed under the Creative Commons Attribution License See"

Similar presentations


Ads by Google