×
Table of Contents
Tutorial and Download Location
GIT Tutorial | https://www.youtube.com/watch?v=SWYqp7iY_Tc&t=8s |
---|---|
Download Location for Windows | https://git-scm.com/download/win |
GIT Concepts & Commands
Concepts | First Commands |
---|---|
“;[/insert_php] | “;[/insert_php] |
Using GIT bash and print version and help panel
GIT Bash Window | |
---|---|
“;[/insert_php] |
|
GIT Functions
Working Directory, Staging Area and Repositories |
---|
“;[/insert_php] |
Init Local Git Repository
Setup Working Directory, Staging Area and Local Repository | |
---|---|
“;[/insert_php] |
Run Scripts:
|
Using .gitignore
Specify intentionally untracked files to be ignored | |
---|---|
“;[/insert_php] |
Run Scripts:
|
Adding some files to the Local Reposiory by running git commit
Adding 2 files to the working area | Details |
---|---|
“;[/insert_php] |
Run Scripts:
|
Commit the changes | Details |
“;[/insert_php] |
Step 2: Commit the data
|
Create an GitHup account and setup an GIT Remote Repository
Create an empty GitHub Remote Repository | |
---|---|
“;[/insert_php] | “;[/insert_php] | “;[/insert_php] |
Run Scripts:
|
GIT Operations tracked by GIT diff command
Git Operation Diagramm | Add. Info |
---|---|
“;[/insert_php] |
Git Storage details
|
Setup | GIT Status |
---|---|
“;[/insert_php] |
Note:
Git Status Details |
First Step: Edit File test.js | Verify GIT Status |
“;[/insert_php] |
Run Scripts: |
Add the test.js to the Staging Area and commit the Transaction | Verify GIT Status |
“;[/insert_php] |
Run Scripts:
|
Using Branches
Step 1: Create Default Branch with C0,C1,C2 Snapshots | Add. Info |
---|---|
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
Run Scripts:
|
Step 2: Checkout Branch iss53 | Add. Info |
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
Run Scripts:
|
Step 3: Implement JS code for C3 Snapshot and finally Commit Branch iss53 | Add. Info |
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
>>> Edit test.js before running script ! Run Scripts: |
Step 4: Checkout master Branch and create new hotfix branch | Add. Info |
“;[/insert_php] |
Run Scripts:
|
Step 5: Modify test.js, Implement Hotfix on Branch hotfix and Commit the data | Add. Info |
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
>>> Edit test.js before running script ! Run Scripts: |
Step 6: Merge master and hotfix Branch | Add. Info |
“;[/insert_php] |
Git Merge Action
|
“;[/insert_php] |
Run Scripts:
|
Step 7: Delete hotfix Branch and continue work on iss53 branch | Add. Info |
“;[/insert_php] |
Run Scripts:
|
Step 8: Implement JS code for C5 Snapshot and finally Commit Branch iss53 | Add. Info |
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
>>> Edit test.js before running script ! Run Scripts: |
Step 9: Try to merge iss53 branch and master branch | Add. Info |
“;[/insert_php] |
Git Merge Details
|
“;[/insert_php] |
>>> NOTE: Merge fails !! Run Scripts: |
Step 10: Display Diffs between common Ancestor C2 and iss53 branch and master branch | Add. Info |
“;[/insert_php] |
Diffs between Ancestor C2/C4 and C2/C5 Snapshot
|
Running Git Mergetool
Step 11: Run git mergetool and fix Merge Conflict |
---|
“;[/insert_php] |
>>> Merge tool
|
Commit the data after MERGE request
Step 12: Commit the Changes done by GIT mergetool | Add. Info |
---|---|
“;[/insert_php] |
Git Branch Details
|
“;[/insert_php] |
>>> NOTE: test.js was corrected in step 11 by using GIT mergetool ! Run Scripts: |
Rename a remote branch
Rename the local branch $ git branch --move STUV-184_TDB STUV-188 Save the new branch to origing $ git push origin --set-upstream STUV-188 warning: redirecting to https://git.informatik.fh-nuernberg.de/study-monitor/pythia-the-counselor.git/ Total 0 (delta 0), reused 0 (delta 0) remote: remote: To create a merge request for STUV-188, visit: remote: https://git.informatik.fh-nuernberg.de/study-monitor/pythia-the-counselor/merge_requests/new?merge_request%5Bsource_branch%5D=STUV-188 remote: To https://git.informatik.fh-nuernberg.de/study-monitor/pythia-the-counselor * [new branch] STUV-188 -> STUV-188 Branch 'STUV-188' set up to track remote branch 'STUV-188' from 'origin'. Delete the old branch $ git push origin --delete STUV-184_TDB warning: redirecting to https://git.informatik.fh-nuernberg.de/study-monitor/pythia-the-counselor.git/ To https://git.informatik.fh-nuernberg.de/study-monitor/pythia-the-counselor - [deleted] STUV-184_TDB
Add current changes to an NEW Branch
Valdiate Status: git status On branch develop Your branch is ahead of 'origin/develop' by 1 commit. (use "git push" to publish your local commits) Changes not staged for commit: (use "git add..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: application/src/main/java/de/thnuernberg/in/stuv/pythia/application/config/ConfigurationService.java Add changes to new Branch git branch STUV-330 git checkout STUV-330 strong>Valdiate Status: On branch STUV-330 Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: application/src/main/java/de/thnuernberg/in/stuv/pythia/application/config/ConfigurationService.java