-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathQuick_GITHUB_Tutorial.txt
More file actions
161 lines (107 loc) · 5.31 KB
/
Quick_GITHUB_Tutorial.txt
File metadata and controls
161 lines (107 loc) · 5.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
This is a quick tutorial on GitHub. For more information,
you may want to read the book;
Introducing Github
Peter Bell & Brent Beer
ISBN: 978-1-491-94974-0
you can find the book online.
********** intro **********
git is a version control system,
github is the web version of it.
using github, you can see team progress, issues, branches,
everything you need to manage a large scale software project.
in general, you will have three basic branches;
-master branch: everything will be merged to this branch eventually
-feature branch: for each feature, you may have a branch
-release branch: all releases may have a separate branch, v1.0, v2.0 etc.
your team must have a branching strategy from the beginning of the project
every branch should have a README.md, where you put basic, introduction information about the branch.
commit history for a file will give you the list of commits, who did it and when.
issues list is to report bugs. team members should always keep an eye on the issues.
one of the most important views of a project is Network tab,
where you can see all the branches and merges in the project life cycle.
members vs team; members who create a fork of the project.
forking means on GitHub, you will have a copy of the project on your GitHub account, not on your local computer.
however, teams are created to work on the project and commit their changes from their local repo to the remote repo.
WE ARE NOT GOING TO EDIT ANYTHING ON GITHUB,
BUT WE WILL COMMIT ALL OUR CHANGES USING COMMAND LINE GIT COMMANDS.
********** first time installation **********
1. Download and install GitHub to your computer (github.com)
2. If you use Windows, to run GitHub commands, use Git Shell
3. open Git Shell application, you are under GitHub folder
4. go online to our JavaFXStudies folder, where you were added as a team member
https://github.com/OpenSourceJavaProject/JavaFXStudies/tree/teamwork
5. click on Clone or download link on the righthand side
6. copy the github address;
https://github.com/OpenSourceJavaProject/JavaFXStudies.git
7. go to your Git Shell and type;
git clone https://github.com/OpenSourceJavaProject/JavaFXStudies.git
8. check the folder structure created. you should have JavaFXStudies folder. Go inside that folder typing;
cd JavaFXStudies
9. type ls -al to see all files listed here;
.git
README.md
10. type git status to see the status of the repo, including the branch name. you should see a similar output;
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
11. now, switch to branch teamwork by typing
git checkout teamwork
the output should be;
Branch teamwork set up to track remote branch teamwork from origin.
Switched to a new branch 'teamwork
12. check the configuration by typing;
git config -l
output should be similar to;
user.name=Murat Ahmet Genc
core.repositoryformatversion=0
core.filemode=false
core.bare=false
core.logallrefupdates=true
remote.origin.url=https://github.com/OpenSourceJavaProject/JavaFXStudies.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
branch.teamwork.remote=origin
branch.teamwork.merge=refs/heads/teamwork
13. IF your email and name is not set, use the following two commands to add your email and name.
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
14. Now you have completed your github configuration. congratulations.
********** how to update REMOTE repo **********
when you modify a file or add a new one, you need to update the repo.
your local repo should be synchronized with the remote repo.
1. for your JavaFX project files, create a new folder with your initials;
an example for me would be muratagenc
2. now you have one folder. go into the folder using cd command. in my case, it would be;
cd muratagenc
3. create a new file named test.txt. you can create the file using Notepad, Wordpad or Word.
4. now, you will use the branch called teamwork, and update the repository. to do that, first switch to the branch teamwork;
git checkout teamwork
5. type the following command to add your changes;
git add *
6. and type the following command;
git commit -m "first test on JavaFxStudies, branch teamwork"
you should receive a similar output:
[teamwork 29bfde8] first test on JavaFxStudies, branch teamwork
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 muratagenc/test.txt
7. finally, you can now push your changes and update the repository.
git push
type your username and password. you should get a similar output;
Counting objects: 6, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (4/4), 361 bytes | 0 bytes/s, done.
Total 4 (delta 0), reused 0 (delta 0)
To https://github.com/OpenSourceJavaProject/JavaFXStudies.git
2f32a72..3526b12 teamwork -> teamwork
8. IF there is a change on the repo, you won't be able to commit your changes. so type,
git pull
to receive latest repo changes, then;
git push
********** how to update LOCAL repo **********
1. since other team members will update remote repo time to time,
you should get the latest copy too. to do that, type;
git pull
the output may show that some files were updated, or your local repo is already up-to-date.