[Q] How to switch branches with repo - Android Software Development

As I get more into android development for the Nexus 6 I have yet to figure out how to update to the latest android build while leaving my local changes. So for example I am working on 5.0.0 and made changes. Now 5.0.2 is out I want to update to that build. The only I have found is going a repo init but to my knowledge this wipes out your changes. Is there a way to switch and merge your local changes?
Thanks in advance

http://gitref.org/

DSA said:
http://gitref.org/
Click to expand...
Click to collapse
So say I have a change in every git repo, would doing those commands through a `repo forall` be the proper way?

sorry, use this one instead:
http://jonas.nitro.dk/git/quick-reference.html
just an example:
Code:
Branches:
git checkout branch Switch working tree to branch
-b branch Create branch before switching to it
git branch List local branches
git branch -f branch rev Overwrite existing branch, start from revision
git merge branch Merge changes from branch
or this:
https://confluence.atlassian.com/display/STASH/Basic+Git+commands
another similar example:
Branches
Create a new branch and switch to it: git checkout -b <branchname>
Switch from one branch to another: git checkout <branchname>
List all the branches in your repo, and also tell you what branch you're currently in: git branch
Delete the feature branch: git branch -d <branchname>
Push the branch to your remote repository, so others can use it: git push origin <branchname>
Push all branches to your remote repository: git push --all origin
Delete a branch on your remote repository: git push origin :<branchname
Click to expand...
Click to collapse

Related

Android 4.0 ICS - getting kernel source

Im looking for the source of the kernel used in ICS.
Looks like "git://android.git.kernel.org/kernel/common" is not there.
Can some one please point me for what vertion is used in ICS and where to clone it from.
Thanks
Check this:
http://source.android.com/source/downloading.html
Google switched to their own servers since the kernel.org break-in
It does not appear to be there. Which means we would have to be patient for kernel devs to get their cook on.
Found some infos here:
http://groups.google.com/group/andr.../87d2802239d46898?show_docid=87d2802239d46898
1st
Code:
git clone https://android.googlesource.com/kernel/common.git
2nd should give you an overview
Code:
git branch -r
3rd checkout a kernel
Code:
git checkout -b android-3.0 origin/android-3.0

[guide][wip] [beginners] how to push a device tree to github

SO AS OF NOW WE HAVE GUIDES ABOUT HOW TO MAKE A KERNEL , ROM FROM SOURCE CODES..THIS GUIDE WILL TALK ABOUT PUSHING THE DEVICE TREE OR KERNEL TREE TO YOUR GITHUB ACCOUNT ...THIS IS A BEGINNER'S GUIDE IN THIS GUIDE I WILL ASSUME THAT UR BUILDING CM 11
STEP1:- CREATE A GITHUB ACCOUNT
STEP 2 :- CREATE A REPOSITORY BY CLICKING THE "+" beside ur user name and name it "android_device_samsung_i9082"
STEP 3 :- in the terminal navigate to the device folder
Code:
cd cm11/device/samsung/i9082
STEP 4 : WE ADD THE REPOSITORY TO WHICH WE HAVE TO PUSH THE FILES TO
Code:
git remote add cm https://github.com/username/android_device_samsung_i9082.git
STEP 5: we create a branch
Code:
git branch cm-11.0
Code:
git checkout cm-11.0
STEP6: WE PUSH THE THE TREE
Code:
git push -u cm cm-11.0
THIS GUIDE IS A WIP ... I WILL UPDATE IT SOON WITH PICTURES ..TO MAKE UL UNDERSTAND BETTER
CREDITS
1) @k2wl
2) help.github.com
3) @jackeagle
reserved
It would be pretty nice if you can add in on how to cherry-pick and git log --graph.Anyways,this guide is very detailed and useful overall and have an awesome say ahead [emoji1][emoji1][emoji106]
Sent from Planet Phaser
The-Grape said:
It would be pretty nice if you can add in on how to cherry-pick and git log --graph.Anyways,this guide is very detailed and useful overall and have an awesome say ahead [emoji1][emoji1][emoji106]
Sent from Planet Phaser
Click to expand...
Click to collapse
Yea sure ... As u saw .. This guide is a wip .. I will add pictures and more .. Fr users to get a better idea of how its done
rutvikrvr said:
Yea sure ... As u saw .. This guide is a wip .. I will add pictures and more .. Fr users to get a better idea of how its done
Click to expand...
Click to collapse
Thanks a lot
[GUIDE]Git Advanced Methods
Sometimes,you might be wondering how can i update the device tree without deleting my current device tree but through applying the latest changes
Well today i will teach you a new function call cherry-picking.This function is one of the most known features of git as it provides simple and easy copy-pasting job for you
First of all,add the remote first.Note:The hello is the main remote for this link
Code:
git remote add name url
eg: git remote add hello https://github.com/AOGP/android_packages_apps_Lightbulb.git
Second,fetch the remote
Code:
git fetch name
eg: git fetch hello
Thirdly,once finish fetching.Copy the commit id from github
Code:
git cherry-pick SHA-1/Commit ID
eg: git cherry-pick a7d0c5fc6df49a07855ccb36fb22fdaf321e20ba
If you faced any errors,solve them by typing and then see the red color files name in the terminal and fix them by comparing between <<<<<<<HEAD
Code:
git status
Once done solving all the errors,push the commit to github to keep the authorship of the commit as it is rude to just use their work and put yourself as author
Code:
git push [name of the remote] [your repository branch]
eg: git push origin master
guide updated in compliance with authorship of commits

[Q] Building Android Source

Simple Question,
I've downloaded android source over Git with
Code:
git clone https://android.googlesource.com/device/asus/grouper
Is this enough?
No. Source.android.com has a complete walkthrough on how to build. You need to do much more than a git clone. You need all the repos for source.
#stayparanoid

how to build AOSP sources?

I tried to compile a AOSP based rom, but after
source build/envsetup.sh
like I do with Cm based roms
brunch is not available.
is brunch CM specific and if so what other command do I need with aosp sources?
DavidXanatos said:
I tried to compile a AOSP based rom, but after
source build/envsetup.sh
like I do with Cm based roms
brunch is not available.
is brunch CM specific and if so what other command do I need with aosp sources?
Click to expand...
Click to collapse
What is the AOSP-based ROM that you're trying to build?
Sent from my GT-S7580 using Tapatalk
it was this rom: http://forum.xda-developers.com/optimus-4x-hd/orig-development/dev-aosp-lollipop-5-0-2-t2995695
and thats the set of cammands with which it builds under bbq linux
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r29
#add local manifest
repo sync
# apply cm 12.1 fixes ld 43 and timeconst
cd /devices/lge/p880/patches
bash ./install.sh
cd ../../../..
source build/envsetup.sh
lunch
#selech p880
# to prevent api error:
make update-api
make -j8
make -j8 otapackage
DavidXanatos said:
it was this rom: http://forum.xda-developers.com/optimus-4x-hd/orig-development/dev-aosp-lollipop-5-0-2-t2995695
and thats the set of cammands with which it builds under bbq linux
Code:
repo init -u https://android.googlesource.com/platform/manifest -b android-5.1.1_r29
#add local manifest
repo sync
# apply cm 12.1 fixes ld 43 and timeconst
cd /devices/lge/p880/patches
bash ./install.sh
cd ../../../..
source build/envsetup.sh
lunch
#selech p880
# to prevent api error:
make update-api
make -j8
make -j8 otapackage
Click to expand...
Click to collapse
Then use
Code:
lunch p880
make -j$(cat /proc/cpuinfo | grep "^processor" | wc -l) otapackage
instead of
Code:
brunch p880
Sent from my GT-S7580 using Tapatalk

[UTILITY][GIT][SCRIPT] Automatize Your Git Workflow

Automatize Your Git Workflow​
General:
Hi XDA,
I created a Windows batch script that helps you to automatize your Git workflow. This batch script includes the most important git commands, new ones will be added with time.
Additionally, I added selfmade git workflows (currently 2) which runs serveral commands in one row. Suggestions for new ones are welcome.
At the moment there's just a Windows version available. Since I don't have any Linux experience, it might be great if someone could port it.
NOTE: Instead of using the Dropbox download link you can always get the files from GitHub. "Master" brench is always the newest one.
Click to expand...
Click to collapse
Functions:
Init repo
Clone Git
Add repo
Get status
Get changes of tracked files
Add file(s) to staging area
Commit file(s)
Change last commit
Get commit log
Get commit log of specified file
Push changes
Pull changes
Fetch changes
Remote info
List remotes
Add remote repo
Discard all local changes
Discard local changes in file
List branches
Switch HEAD branch
Create branch
Delete branch
Push branch
Add tags
Merge branch into HEAD
Rebase HEAD onto branch
Custom made workflows (2)
Click to expand...
Click to collapse
Windows Download:
Download
Click to expand...
Click to collapse
GitAutomating on GitHub:
MyGithub
Click to expand...
Click to collapse
Newest Version:
25.09.2016: v1.1
Click to expand...
Click to collapse
Screenshots in "Screenshots" section available
Please report bugs and give feedback
XDA:DevDB Information
Git Automating, Tool/Utility for all devices (see above for details)
Contributors
Lars124
Version Information
Status: Testing
Created 2016-09-19
Last Updated 2016-09-19
Changelog:
25.09.2016:
- Added "tag" function
- Added "own command" function
- Other minor imporvements
19.09.2016:
- Initial Release
Click to expand...
Click to collapse
Update with new functions comes this week!
Sent from my Moto G 2014 using Tapatalk
UPDATE v1.1 is online
25.09.2016:
- Added "tag" function
- Added "own command" function
- Other minor imporvements

Categories

Resources