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 11:56] – va7fi | howto:git [2021/12/26 12:26] (current) – [Test Scenarios] va7fi | ||
---|---|---|---|
Line 2: | Line 2: | ||
===== Test Scenarios ===== | ===== Test Scenarios ===== | ||
Summary: | Summary: | ||
- | * When cloning from remote to local, '' | + | * When cloning from remote to local or pushing from local to remote, '' |
- | * When pushing local changes to remote, | + | * When pushing local changes to remote, |
+ | References: | ||
+ | * [[https:// | ||
+ | * Using [[https:// | ||
+ | | ||
==== Initial Cloning ==== | ==== Initial Cloning ==== | ||
* Create two files in a '' | * Create two files in a '' | ||
Line 41: | Line 44: | ||
</ | </ | ||
- | * But the '' | + | * But the '' |
~/ | ~/ | ||
total 24 | total 24 | ||
Line 48: | Line 51: | ||
</ | </ | ||
- | * Change the group back to '' | + | * Change the group back to '' |
- | sudo chgrp www-data * | + | sudo chgrp www-data |
ls -l | ls -l | ||
total 24 | total 24 | ||
- | -rwxrwxr-x 1 ptruchon www-data 26 Dec 26 10:24 file1.txt | + | -rwxrwx--- 1 ptruchon www-data 26 Dec 26 10:24 file1.txt |
- | -rwxrwxr-x 1 ptruchon www-data 26 Dec 26 10:24 file2.txt | + | -rwxrwx--- 1 ptruchon www-data 26 Dec 26 10:24 file2.txt |
</ | </ | ||
Line 97: | Line 100: | ||
==== Push Changes to Remote ==== | ==== Push Changes to Remote ==== | ||
- | * Try to push changes to remote while master is still checked out on remote:< | + | * Attempting |
~/ | ~/ | ||
Enumerating objects: 5, done. | Enumerating objects: 5, done. | ||
Line 124: | Line 127: | ||
</ | </ | ||
- | * Checkout | + | * Workaround is to checkout |
~/ | ~/ | ||
Switched to a new branch ' | Switched to a new branch ' | ||
</ | </ | ||
- | * Push changes to remote while tmp is checked out on remote:< | + | * Then push the local changes to remote:< |
~/ | ~/ | ||
Enumerating objects: 5, done. | Enumerating objects: 5, done. | ||
Line 160: | Line 163: | ||
initial commit on remote | initial commit on remote | ||
+ | </ | ||
+ | |||
+ | * On remote, checkout master and delete the temporary branch< | ||
+ | ~/ | ||
+ | Switched to branch ' | ||
+ | Deleted branch tmp (was 0e5ccde). | ||
+ | </ | ||
+ | |||
+ | * Status and log both look good:< | ||
+ | git status | ||
+ | On branch master | ||
+ | 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 | ||
+ | Author: Patrick Truchon < | ||
+ | Date: Sun Dec 26 10:21:24 2021 -0800 | ||
+ | |||
+ | initial commit on remote | ||
+ | </ | ||
+ | |||
+ | * But group ownership of the modified file wasn't preserved< | ||
+ | ~/ | ||
+ | total 24 | ||
+ | -rwxrwxr-x 1 ptruchon ptruchon 50 Dec 26 12:01 file1.txt | ||
+ | -rwxrwx--- 1 ptruchon www-data 26 Dec 26 10:20 file2.txt | ||
</ | </ | ||
howto/git.1640548583.txt.gz · Last modified: 2021/12/26 11:56 by va7fi