0% found this document useful (0 votes)
73 views3 pages

Git Assingment Start To End

The document provides instructions for using Git as a local and remote version control system. It describes setting up Git locally, making commits on the local repository, branching and merging, and finally pushing code to a remote GitHub repository for collaboration. Key steps include initializing a Git repository, making commits on the master branch, creating and switching between branches for different assignments (HTML, CSS, JavaScript), and merging branches into master. It also covers creating a GitHub repository, committing a sample file, and pushing a project from Eclipse to the remote for other developers to access.

Uploaded by

Syed Danish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
73 views3 pages

Git Assingment Start To End

The document provides instructions for using Git as a local and remote version control system. It describes setting up Git locally, making commits on the local repository, branching and merging, and finally pushing code to a remote GitHub repository for collaboration. Key steps include initializing a Git repository, making commits on the master branch, creating and switching between branches for different assignments (HTML, CSS, JavaScript), and merging branches into master. It also covers creating a GitHub repository, committing a sample file, and pushing a project from Eclipse to the remote for other developers to access.

Uploaded by

Syed Danish
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Install GIT & make sure it is added into PATH.

Section 0 -Use GIT as local VCS. Steps to follow:

1. Create a directory ‘project_dir’ & cd to ‘project_dir’.


2. Initialize git version database. (git init)
3. Create a new file index.html.
4. Check the git status. You should find index.html as untracked file.
5. Stage the index.html file.
6. Commit index.html
7. Make few changes in index.html & create a new file info.txt file.
8. Check git status. You should find index.html & info.txt as untracked files.
9. Configure GIT to ignore all txt files.
10. Again check the git status. You should find only index.html as untracked file.
11. State & commit index.html
12. Log all your comments so far.
13. Make some changes in index.html.
14. Revert the change made in the previous step using git command.
15. Again change index.html.
16. Stage index.html
17. Revert back the last stage.
18. Rename ‘add’ command to ‘my-add’.
19. Using my_add command Stage index.html again & commit the changes.
20. Revert the last commit.

GIT Branching
Objective: Commit HTML, CSS & JavaScript assignments into GIT.

SECTION-1 (HTML assignments) - Steps to follow:

21. First take a backup of your assignments & projects. This is required because due to
incorrect GIT operation you may lose your files.
22. Create an empty directory ‘Assignments’ & cd to ‘Assignments’.
23. Create a file README.txt inside ‘Assignments’ & write few lines about the contents of
‘Assignments’ folder.
24. Commit README.txt file.
25. Now create a new branch ‘html-assignments’.
26. Switch to ‘html-assignments’ branch.
27. Copy all HTML assignments inside ‘Assignments’ folder.
28. Commit HTML assignments into ‘html-assignments’ branch.
29. Make minor changes into few files belonging to ‘html-assignments’ branch.
30. Commit those changed files.
31. Switch to master branch.
32. Make minor changes into README.txt file & commit those changes into master.
33. Again switch to ‘html-assignments’ branch.
34. Make minor changes into few files belonging to ‘html-assignments’ branch.
35. Commit those changes.
36. Switch to master.
37. Merge ‘html-assignments’ branch into master. Confirm all html assignments are shown
in master.
38. Finally delete the ‘html-assignments’ branch.

SECTION-2 - (CSS assignments) Steps to follow:

1. Create a new branch ‘css-assignments’.


2. Switch to ‘css-assignments’ branch.
3. Copy all CSS assignments inside ‘Assignments’ folder.
4. Commit CSS assignments into ‘css-assignments’ branch.
5. Make minor changes into README.txt file on line 1 belonging to ‘css-assignments’
branch.
6. Commit those changed files.
7. Switch to master branch.
8. Make minor changes into README.txt file on line 3 & commit those changes into
master.
9. Again switch to ‘css-assignments’ branch.
10. Make minor changes into few files belonging to ‘css-assignments’ branch.
11. Commit those changes.
12. Switch to master.
13. Merge ‘css-assignments’ branch into master. Confirm all css assignments are shown in
master.
14. Finally delete the ‘css-assignments’ branch.

SECTION-3 - (JavaScript assignments) Steps to follow:

1. Create a new branch ‘js-assignments’.


2. Switch to ‘js-assignments’ branch.
3. Copy all JavaScript assignments inside ‘Assignments’ folder.
4. Commit JavaScript assignments into ‘js-assignments’ branch.
5. Make minor changes into README.txt file on line 1 belonging to ‘js-assignments’ branch.
6. Commit those changed files.
7. Switch to master branch.
8. Make minor changes into README.txt file on line 1 & commit those changes into
master.
9. Again switch to ‘js-assignments’ branch.
10. Make minor changes into few files belonging to ‘js-assignments’ branch.
11. Commit those changes.
12. Switch to master.
13. Merge ‘js-assignments’ branch into master. Confirm all JavaScript assignments are
shown in master.
14. Finally delete the ‘js-assignments’ branch.

GIT Remoting
Objective: Pushing source code into GITHUB & collaborate team members.

SECTION-3 (Pushing assignments to remote repository) - Steps to follow:

39. Create a github account if you do not have already.


40. Login on into github account.
41. Create new public repository ‘freshersbatch-oct16’.
42. Commit & push any sample file to this repository under ‘Assignments’ directory.

SECTION-4 (Pushing source code to remote repository using Eclipse GIT plugin) - Steps to follow:

1. One developer from project team will create eclipse projects ‘SampleProj’ & add sample
source code files. Then commit all files through eclipse GIT plugin.
2. Collaborate other team members with your github account so that they can also modify
the committed files.
3. Other developers from same team will checkout all files from remote repository. This
might get conflicts since certain files fail to merge. In such case, merge it manually.
4. Commit & push the ‘SampleProj’ project.

You might also like