[T-Mobile Samsung Galaxy Note 3] jcadduono:
Reserved

EVER WANTED TO MAKE YOUR OWN KERNEL FORK?

jcadduono's GitHub forking crash course

1. Make an account on GitHub!

2. Use the fork button @ https://github.com/jcadduono/idleKernel-note3 or any other repository

3. In your terminal emulator, cd to the location you want your repository.

4. git clone https://github.com/YOUR_USERNAME/idleKernel-note3.git

(optionally add folder name after that command to change it to something other than idleKernel-note3)

5. cd idleKernel-note3

6. git remote add jc https://github.com/jcadduono/idleKernel-note3.git

(this will allow you to send commits to me, cherry-pick commits from me, or pull new commits from me!)

7. git fetch jc

(do this whenever you want updated commits from me to be available to you for cherry-picking or merging)

8. Be sure to set your git author information too, for proper commit info!

git config --global user.name "Your Name"

git config --global user.email "your@email.com"

git config --global push.default simple

(that last one just removes a warning message whenever you push commits to github)

9. Whenever you want to pull all the latest and greatest commits from me all at once, run:

git fetch jc

git merge jc

I don't recommend doing that though, because if our branches diverge too much our commits might become incompatible or you might not want some of my changes.

The best way to do it would be to:

git fetch jc

git log jc/X

Replace X with ik-touchwiz/ik-cm12.1/ik-slim5.1, that will show you all of my commits.

For every new commit you want, cherry-pick one at a time to make sure each goes successfully.

git cherry-pick <hash from git log jc/X>

10. Now whenever you make changes to your fork, and you are satisfied with them, you can do:

git add .

(that adds every changed file to the next git commit)

or

git add <file>

then

git diff HEAD

(this is optional, but I recommend looking over everything you changed to make sure it makes sense and you can find extra whitespace or typos!)

11. Once you are satisfied with the changes you've made, you can commit them to the branch history.

git commit -m "made some great change that you detail here"

12. To put your new commits up on GitHub, all you have to do is:

git push

13. If you want to send that commit to me as well, you can do:

git push jc

TIPS

Made a mistake and committed it already? You can time travel through git history using the rebase command!

git rebase -i HEAD~X

Replace X with how far back in commit history you want to edit, trust me time travel is a bad idea.

Just change pick to drop and Ctrl+X Y enter, git will make that commit disappear forever like it never happened.

You can also use various other words like reword to change the message of a commit, etc.

In order for GitHub to accept rebases, you have to add -f to git push, but only if you are changing history you've already pushed to GitHub.

If you've already pushed a commit to GitHub and want to undo it, you can do:

git log

git revert xxxxxx

Replace xxxxxx with the hash of the commit you want undone.

If you haven't pushed to GitHub yet, using git rebase is fine for undoing or rewording commits. :)

Any time you want to see all the changes from one of my commits, you can use

git show xxxxxxxx

Replace xxxxxxxx with the hash from git log jc/X or even your own git log.

It pipes a nice scrollable colored diff through `less` :)

If you want to stop it from asking for your GitHub username when you push, in idleKernel-note3 directory do:

nano .git/config

Find a line that looks like:

url = https://github.com/......

Add before github.com so it looks like this:

url = https://your-github-username@github.com/...

Now press Ctrl+X Y enter to save.