Skip to content

Instantly share code, notes, and snippets.

@drgroovestarr
Created December 18, 2015 17:37
Show Gist options
  • Save drgroovestarr/1cad2ac242cba1a75f6a to your computer and use it in GitHub Desktop.
Save drgroovestarr/1cad2ac242cba1a75f6a to your computer and use it in GitHub Desktop.
Just git things

PUSHING FRESH FILES TO SOURCE:

Create repo in github Have the files ready locally cd

git remote add git branch git checkout git push -u

FOR ONE COMMIT:

I repo sync my source I clone the repo i want to work in into edits folder using git clone (repo link).git -b (branch) CD into cloned folder git checkout (branch) type git remote add (remote name) (repo you need link) -t (branch you want) git fetch (remote name) then either git cherry-pick (commit number from that repo) *Fix errors if they conflict..It will tell you.. I then swap out my folder in my tree for the one im working in edits and build...work the files, make edits.. then once it works, all i need to do is cd into said edited folder in source git add -A git commit git push as my OG folder was cloned with -b flag, no checkout, changes, etc need to be made pushes easy peasy like a bran poop

TO MERGE ALL UPSTREAM CHANGES:

clone the repo you want to work in into edits folder using git clone (repo link).git -b (branch) cd into cloned folder type git remote add (name for remote) (link to repo you want changes from) -t (branch you need from them) git fetch (remote name you gave it) git merge (remote name)/(remote branch) (need the /) hopefully it merges cleanly, if not, it will tell you the said files that conflicted..MAKE SURE TO ONLY MERGE UPSTREAM FROM THE REPO FOR THE INITIAL FORK then once it works, all i need to do is cd into said edited folder in source git add -A git commit git push

TO MERGE IN SHIT BEING WORKED IN THE TREE:

Just create a repo for it on the hub Then in your tree CD into XXXX folder

git checkout -b (branch)

In the folder, to make a new branch based on your current one git remote add broken (link to our repo) Add the remote for XXXXX Cherry-pick the commit Fire a build If it works git add -A git commit git push broken (branch)

AMEND LAST COMMIT:

Make amendment git pull git add -A git commit --amend git push

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment