Check out my ugly tree:
* 8d61057 (HEAD -> master) file4
* 61795ae Merge branch 'new'
|\
| * 56f104d file2
* | 2484695 file3
|/
* ecc3f4f init
Notice that 61795ae Merge branch 'new'
introduces nothing new, but is merely a merge commit.
I can get my trunk back in a straight line with rebase
from the last commit before the split.
git rebase ecc3f4f
Now the tree is all straight again
* e794681 (HEAD -> master) file4
* b65595a file3
* 3d6ffe9 file2
* ecc3f4f init
Explanation
After cloning your project, I wanted to take a look at the commits to see the conflict.
You renamed this backup script.
051dae3 Rename backup final ftp.py to backup ftp v.4 (final).py
Backup scripts/backup final ftp.py → Backup scripts/backup ftp v.4 (final).py
But at the same time in another clone of this repository, you moved this backup script into a "Python" folder with a group of others
09abfd7 Renamed some of the files
Backup scripts/backup final ftp.py → Python/Backup scripts/backup final ftp.py
Now to resolve this conflict, you had to clean it up with two commits.
The first one just to get the file out of the right folder to the wrong folder with the right name.
8006e70 Renamed some files
Python/Backup scripts/backup final ftp.py → Backup scripts/backup ftp v.4 (final).py
Then you just lost that file with the "unneeded folder"
bac2105 Deleted an unneeded folder
deleted Backup scripts/backup ftp v.4 (final).py
Basically, it was a matter of checking out those two commits, resetting them softly to the staging area, and committing them all in one.
Then cherry-pick the rest. You can clone the straight master branch here
Procedure
git clone https://github.com/Lowe-Man/Portfolio
cd Portfolio/
git log --graph --oneline --decorate --all
* de71d41 (HEAD -> master, origin/master, origin/HEAD) Removed a gitignore specifier from the .gitignore file
* f80eb5c Added 'Lecture 26 Files'
* 505478e Added 'Lecture 25 Tuples'
* 632a2f3 Added 'Lecture 23 Dictionaries'
* 990d74e Reorganized/Fixed all of the code/comments on all of the lectures that I have done up to this point
* bb213ac Added 'Lecture 21 Lists'
* ab99b1c Added 'Lecture 19 Print Formatting'
* 3f37ca3 Changed the numbering of the files
* 16e17be Added 'Lecture 16 Strings'
* c654494 Reorganized the repository
* 60b17e4 Added 'Remove Numbers v.1.py'
* e35b6ba Added 'Lecture 14 Numbers'
* bac2105 Deleted an unneeded folder
* 8006e70 Renamed some files
|\
| * 051dae3 Rename backup final ftp.py to backup ftp v.4 (final).py
* | 09abfd7 Renamed some of the files
|/
* 0fa9983 Everything is in working order
* dfc9747 Fixed a few if statements
* e183900 Added Countdown Timers and other help to the portfolio
* 2377980 Removed some unnecessary lines of code
* 4172115 Added some new fetures to the script
* 4a7f2d1 Fixed some minor bugs in the code
* 589251c Removed text from a variable
* 93e9742 Finished the backup final ftp script for now
* c5687a3 Added the feature to remove files/folders that are older than a certain age
* 19a495f Removed some blank lines at the bottom of the file
* c2c58c3 Converts the folder to a .tar.bz2 and then deletes the folder
* 6718968 Made some minor changes to the code to increase usability
* b7d6608 Initial commit
git checkout 051dae3
git reset --soft HEAD~
git status
HEAD detached from 051dae3
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: Backup scripts/backup final ftp.py -> Backup scripts/backup ftp v.4 (final).py
git checkout 09abfd7
git reset --soft HEAD~
git status
HEAD detached from 09abfd7
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
new file: Backup scripts/backup ftp v.4 (final).py
renamed: Backup scripts/backup final ftp.py -> Python/Backup scripts/backup final ftp.py
renamed: Backup scripts/backup ftp v.1.py -> Python/Backup scripts/backup ftp v.1.py
renamed: Backup scripts/backup ftp v.2.py -> Python/Backup scripts/backup ftp v.2.py
renamed: Backup scripts/backup ftp v.3.py -> Python/Backup scripts/backup ftp v.3.py
new file: Python/Backup scripts/backup local.py
renamed: Countdown Timers/Countdown Timer (Cleaned).py -> Python/Countdown Timers/Countdown Timer v.2.py
new file: Python/Countdown Timers/Countdown Timer v.3 (final).py
renamed: Countdown Timers/Coutdown Timer.py -> Python/Countdown Timers/Coutdown Timer (original).py
renamed: Countdown Timers/Coutdown Timer (Improved).py -> Python/Countdown Timers/Coutdown Timer v.1.py
renamed: Help/How to remove zeros.py -> Python/Help/How to remove zeros.py
renamed: Help/Timezone.py -> Python/Help/Timezone.py
renamed: Countdown Timers/length.py -> Python/Help/length.py
Ditch the extra copy, and move the correctly named one into the Python
folder.
rm 'Python/Backup scripts/backup final ftp.py'
mv 'Backup scripts/backup ftp v.4 (final).py' 'Python/Backup scripts/backup ftp v.4 (final).py'
git add .
git status
HEAD detached from 09abfd7
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
renamed: Backup scripts/backup ftp v.1.py -> Python/Backup scripts/backup ftp v.1.py
renamed: Backup scripts/backup ftp v.2.py -> Python/Backup scripts/backup ftp v.2.py
renamed: Backup scripts/backup ftp v.3.py -> Python/Backup scripts/backup ftp v.3.py
renamed: Backup scripts/backup final ftp.py -> Python/Backup scripts/backup ftp v.4 (final).py
new file: Python/Backup scripts/backup local.py
renamed: Countdown Timers/Countdown Timer (Cleaned).py -> Python/Countdown Timers/Countdown Timer v.2.py
new file: Python/Countdown Timers/Countdown Timer v.3 (final).py
renamed: Countdown Timers/Coutdown Timer.py -> Python/Countdown Timers/Coutdown Timer (original).py
renamed: Countdown Timers/Coutdown Timer (Improved).py -> Python/Countdown Timers/Coutdown Timer v.1.py
renamed: Help/How to remove zeros.py -> Python/Help/How to remove zeros.py
renamed: Help/Timezone.py -> Python/Help/Timezone.py
renamed: Countdown Timers/length.py -> Python/Help/length.py
In addition to everything else we renamed, the staged resolution of interest is:
renamed: Backup scripts/backup final ftp.py -> Python/Backup scripts/backup ftp v.4 (final).py
Make a new commit using the same message.
git commit -c ORIG_HEAD
git log --graph --oneline --decorate --all
* 1cc1b2c (HEAD) Renamed some of the files
| * de71d41 (origin/master, origin/HEAD, master) Removed a gitignore specifier from the .gitignore file
| * f80eb5c Added 'Lecture 26 Files'
| * 505478e Added 'Lecture 25 Tuples'
| * 632a2f3 Added 'Lecture 23 Dictionaries'
| * 990d74e Reorganized/Fixed all of the code/comments on all of the lectures that I have done up to this point
| * bb213ac Added 'Lecture 21 Lists'
| * ab99b1c Added 'Lecture 19 Print Formatting'
| * 3f37ca3 Changed the numbering of the files
| * 16e17be Added 'Lecture 16 Strings'
| * c654494 Reorganized the repository
| * 60b17e4 Added 'Remove Numbers v.1.py'
| * e35b6ba Added 'Lecture 14 Numbers'
| * bac2105 Deleted an unneeded folder
| * 8006e70 Renamed some files
| |\
| | * 051dae3 Rename backup final ftp.py to backup ftp v.4 (final).py
| |/
|/|
| * 09abfd7 Renamed some of the files
|/
* 0fa9983 Everything is in working order
* dfc9747 Fixed a few if statements
* e183900 Added Countdown Timers and other help to the portfolio
* 2377980 Removed some unnecessary lines of code
* 4172115 Added some new fetures to the script
* 4a7f2d1 Fixed some minor bugs in the code
* 589251c Removed text from a variable
* 93e9742 Finished the backup final ftp script for now
* c5687a3 Added the feature to remove files/folders that are older than a certain age
* 19a495f Removed some blank lines at the bottom of the file
* c2c58c3 Converts the folder to a .tar.bz2 and then deletes the folder
* 6718968 Made some minor changes to the code to increase usability
* b7d6608 Initial commit
Now we've effectively combined commits 051dae3
, 8006e70
, and bac2105
into 09abfd7
as a new commit 1cc1b2c
which is the way I think it should have functionally been committed in the first place.
So all that's left is to cherry-pick the rest of the tree starting from e35b6ba Added 'Lecture 14 Numbers'
git cherry-pick e35b6ba^..de71d41
git log --graph --oneline --decorate --all
* 0e52036 (HEAD) Removed a gitignore specifier from the .gitignore file
* 1cf948b Added 'Lecture 26 Files'
* 62a1602 Added 'Lecture 25 Tuples'
* aeb7421 Added 'Lecture 23 Dictionaries'
* d47635d Reorganized/Fixed all of the code/comments on all of the lectures that I have done up to this point
* d54141c Added 'Lecture 21 Lists'
* 66174f2 Added 'Lecture 19 Print Formatting'
* 3969da2 Changed the numbering of the files
* 9c4828c Added 'Lecture 16 Strings'
* ce159a3 Reorganized the repository
* 759e08b Added 'Remove Numbers v.1.py'
* 323be27 Added 'Lecture 14 Numbers'
* 1cc1b2c Renamed some of the files
| * de71d41 (origin/master, origin/HEAD, master) Removed a gitignore specifier from the .gitignore file
| * f80eb5c Added 'Lecture 26 Files'
| * 505478e Added 'Lecture 25 Tuples'
| * 632a2f3 Added 'Lecture 23 Dictionaries'
| * 990d74e Reorganized/Fixed all of the code/comments on all of the lectures that I have done up to this point
| * bb213ac Added 'Lecture 21 Lists'
| * ab99b1c Added 'Lecture 19 Print Formatting'
| * 3f37ca3 Changed the numbering of the files
| * 16e17be Added 'Lecture 16 Strings'
| * c654494 Reorganized the repository
| * 60b17e4 Added 'Remove Numbers v.1.py'
| * e35b6ba Added 'Lecture 14 Numbers'
| * bac2105 Deleted an unneeded folder
| * 8006e70 Renamed some files
| |\
| | * 051dae3 Rename backup final ftp.py to backup ftp v.4 (final).py
| |/
|/|
| * 09abfd7 Renamed some of the files
|/
* 0fa9983 Everything is in working order
* dfc9747 Fixed a few if statements
* e183900 Added Countdown Timers and other help to the portfolio
* 2377980 Removed some unnecessary lines of code
* 4172115 Added some new fetures to the script
* 4a7f2d1 Fixed some minor bugs in the code
* 589251c Removed text from a variable
* 93e9742 Finished the backup final ftp script for now
* c5687a3 Added the feature to remove files/folders that are older than a certain age
* 19a495f Removed some blank lines at the bottom of the file
* c2c58c3 Converts the folder to a .tar.bz2 and then deletes the folder
* 6718968 Made some minor changes to the code to increase usability
* b7d6608 Initial commit
Now we can delete our old master branch, use this one as the new master, and force push to the remote.
git branch -d master
git checkout -b master
git push origin master --force
git log --graph --oneline --decorate --all
* 0e52036 (HEAD -> master, origin/master, origin/HEAD) Removed a gitignore specifier from the .gitignore file
* 1cf948b Added 'Lecture 26 Files'
* 62a1602 Added 'Lecture 25 Tuples'
* aeb7421 Added 'Lecture 23 Dictionaries'
* d47635d Reorganized/Fixed all of the code/comments on all of the lectures that I have done up to this point
* d54141c Added 'Lecture 21 Lists'
* 66174f2 Added 'Lecture 19 Print Formatting'
* 3969da2 Changed the numbering of the files
* 9c4828c Added 'Lecture 16 Strings'
* ce159a3 Reorganized the repository
* 759e08b Added 'Remove Numbers v.1.py'
* 323be27 Added 'Lecture 14 Numbers'
* 1cc1b2c Renamed some of the files
* 0fa9983 Everything is in working order
* dfc9747 Fixed a few if statements
* e183900 Added Countdown Timers and other help to the portfolio
* 2377980 Removed some unnecessary lines of code
* 4172115 Added some new fetures to the script
* 4a7f2d1 Fixed some minor bugs in the code
* 589251c Removed text from a variable
* 93e9742 Finished the backup final ftp script for now
* c5687a3 Added the feature to remove files/folders that are older than a certain age
* 19a495f Removed some blank lines at the bottom of the file
* c2c58c3 Converts the folder to a .tar.bz2 and then deletes the folder
* 6718968 Made some minor changes to the code to increase usability
* b7d6608 Initial commit