howto:git
                Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| howto:git [2021/12/26 10:46] – [Test Scenarios] va7fi | howto:git [Unknown date] (current) – removed - external edit (Unknown date) 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ====== Git ====== | ||
| - | ===== Test Scenarios ===== | ||
| - | ==== Initial Cloning ==== | ||
| - | Summary: ownership is not preserved. | ||
| - | |||
| - | * Create two files in a '' | ||
| - | |||
| - | * Change their permissions and ownership to match what's on the server:< | ||
| - | ~/ | ||
| - | |||
| - | total 24 | ||
| - | -rwxrwx--- 1 ptruchon www-data 26 Dec 26 10:20 file1.txt | ||
| - | -rwxrwx--- 1 ptruchon www-data 26 Dec 26 10:20 file2.txt | ||
| - | </ | ||
| - | |||
| - | * Initialize git:< | ||
| - | git init | ||
| - | git add . | ||
| - | git commit -m ' | ||
| - | git log | ||
| - | |||
| - | commit 0e5ccdedd1c9188996aadad3a8e2be5a319ab789 (HEAD -> master) | ||
| - | Author: Patrick Truchon < | ||
| - | Date: Sun Dec 26 10:21:24 2021 -0800 | ||
| - | |||
| - | initial commit on remote | ||
| - | </ | ||
| - | |||
| - | * Create a local folder and clone from remote:< | ||
| - | git clone ~/ | ||
| - | </ | ||
| - | |||
| - | * The log on the local copy looks good:< | ||
| - | ~/ | ||
| - | |||
| - | commit 0e5ccdedd1c9188996aadad3a8e2be5a319ab789 (HEAD -> master, origin/ | ||
| - | Author: Patrick Truchon < | ||
| - | Date: Sun Dec 26 10:21:24 2021 -0800 | ||
| - | |||
| - | initial commit on remote | ||
| - | </ | ||
| - | |||
| - | * But the '' | ||
| - | ~/ | ||
| - | |||
| - | total 24 | ||
| - | -rwxrwxr-x 1 ptruchon ptruchon 26 Dec 26 10:24 file1.txt | ||
| - | -rwxrwxr-x 1 ptruchon ptruchon 26 Dec 26 10:24 file2.txt | ||
| - | </ | ||
| - | |||
| - | * Change the group back to '' | ||
| - | sudo chgrp www-data * | ||
| - | ls -l | ||
| - | |||
| - | total 24 | ||
| - | -rwxrwxr-x 1 ptruchon www-data 26 Dec 26 10:24 file1.txt | ||
| - | -rwxrwxr-x 1 ptruchon www-data 26 Dec 26 10:24 file2.txt | ||
| - | </ | ||
| - | |||
| - | ==== Making Local Changes ==== | ||
| - | * Edit '' | ||
| - | ~/ | ||
| - | |||
| - | On branch master | ||
| - | Your branch is up to date with ' | ||
| - | |||
| - | Changes not staged for commit: | ||
| - | (use "git add < | ||
| - | (use "git restore < | ||
| - | modified: | ||
| - | |||
| - | no changes added to commit (use "git add" and/or "git commit -a") | ||
| - | </ | ||
| - | |||
| - | * Commit changes in git:< | ||
| - | git add . | ||
| - | git commit -m ' | ||
| - | git status | ||
| - | |||
| - | On branch master | ||
| - | Your branch is ahead of ' | ||
| - | (use "git push" to publish your local commits) | ||
| - | |||
| - | nothing to commit, working tree clean | ||
| - | |||
| - | git log | ||
| - | |||
| - | commit b7d91058fed9fe64c96525a3d0bef56c682ade68 (HEAD -> master) | ||
| - | Author: Patrick Truchon < | ||
| - | Date: Sun Dec 26 10:45:41 2021 -0800 | ||
| - | |||
| - | changed file1.txt from local | ||
| - | |||
| - | commit 0e5ccdedd1c9188996aadad3a8e2be5a319ab789 (origin/ | ||
| - | Author: Patrick Truchon < | ||
| - | Date: Sun Dec 26 10:21:24 2021 -0800 | ||
| - | |||
| - | initial commit on remote | ||
| - | </ | ||
| - | |||
| - | |||
| - | |||
howto/git.1640544399.txt.gz · Last modified:  by va7fi
                
                
