? How to build CMAccount - Android Q&A, Help & Troubleshooting

I've been building my own nightlies of CM 10.2 for my mako. I was curious if anyone has any links to guides on how to pull and build the CMAccount app from source? I wanted to play around with it and see what it looks like..
From what I gather, I just need to add the CMAccount git path to my roomservice.xml, then sync and build, will it be in the completed rom, or do I have to inject the app somewhere?
Thanks

VoiD_Dweller said:
I've been building my own nightlies of CM 10.2 for my mako. I was curious if anyone has any links to guides on how to pull and build the CMAccount app from source? I wanted to play around with it and see what it looks like..
From what I gather, I just need to add the CMAccount git path to my roomservice.xml, then sync and build, will it be in the completed rom, or do I have to inject the app somewhere?
Thanks
Click to expand...
Click to collapse
If you want to take a look at the source code for the CMAccount app you can find the full source code on the Cyanogenmod Github here https://github.com/CyanogenMod/android_packages_apps_CMAccount. Then if you want to modify and play around with the source code and make your own changes you can import the app source code into Eclipse (From the Eclipse menu File -> New Project -> Android Project -> Select "Existing Project") after git cloning the CMAccount repository. To add it to your ROM what you can do is use local_manifest.xml to add the CMAccount source code to be built into your ROM by default. For some great guides on using local_manifest.xml when compiling I would recommend checking out these guides here, and here, as well as this guide to adding your own app during compiling here. Let me know if you still have questions.

shimp208 said:
If you want to take a look at the source code for the CMAccount app you can find the full source code on the Cyanogenmod Github here https://github.com/CyanogenMod/android_packages_apps_CMAccount. Then if you want to modify and play around with the source code and make your own changes you can import the app source code into Eclipse (From the Eclipse menu File -> New Project -> Android Project -> Select "Existing Project") after git cloning the CMAccount repository. To add it to your ROM what you can do is use local_manifest.xml to add the CMAccount source code to be built into your ROM by default. For some great guides on using local_manifest.xml when compiling I would recommend checking out these guides here, and here, as well as this guide to adding your own app during compiling here. Let me know if you still have questions.
Click to expand...
Click to collapse
Thanks a bunch for the links and help. I went ahead and added it to my roomservice in local_manifests as follows:
Code:
<project name="CyanogenMod/android_packages_apps_CMAccount" path="packages/apps" remote="github" />
I also did a git fetch git://github.com/CyanogenMod/android_packages_apps_CMAccount and another repo sync.
It seemed to pick it up, is a clone preferred, or is fetch adequate? Missing anything? I'm attempting a build and hoping it works..

VoiD_Dweller said:
Thanks a bunch for the links and help. I went ahead and added it to my roomservice in local_manifests as follows:
Code:
<project name="CyanogenMod/android_packages_apps_CMAccount" path="packages/apps" remote="github" />
I also did a git fetch git://github.com/CyanogenMod/android_packages_apps_CMAccount and another repo sync.
It seemed to pick it up, is a clone preferred, or is fetch adequate? Missing anything? I'm attempting a build and hoping it works..
Click to expand...
Click to collapse
A fetch is fine, a clone is really only needed if you want to take a look at the source code, or want to download the source code to modify. Overall, for what you want to do integrating the app in your ROM a fetch will work just fine.

Related

[ROM][SGH-I777][4.0.4] CyanogenMod 9 nightly builds | DEVELOPMENT THREAD

DEVELOPMENT THREAD
FOR DEVELOPERS ONLY​
DISCUSSION THREAD FOR USERS:
http://forum.xda-developers.com/showthread.php?t=1568848​
CyanogenMod is a free, community built, aftermarket firmware distribution of Android 4.0 (ICS), which is designed to increase performance and reliability over stock Android for your device.
Code:
#include <std_disclaimer.h>
/*
* Your warranty is now void.
*
* I am not responsible for bricked devices, dead SD cards,
* thermonuclear war, or you getting fired because the alarm app failed. Please
* do some research if you have any concerns about features included in this ROM
* before flashing it! YOU are choosing to make these modifications, and if
* you point the finger at me for messing up your device, I will laugh at you.
*
* Submitting bug reports on nightly builds is the leading
* cause of male impotence.
*/
CyanogenMod is based on the Android Open Source Project with extra contributions from many people within the Android community. It can be used without any need to have any Google application installed. Linked below is a package that has come from another Android project that restore the Google parts. CyanogenMod does still include various hardware-specific code, which is also slowly being open-sourced anyway.
All the source code for CyanogenMod is available in the CyanogenMod Github repo. And if you would like to contribute to CyanogenMod, please visit out Gerrit Code Review. You can also view the Changelog for a full list of changes & features.
General:
http://github.com/CyanogenMod
Device (you need both):
http://github.com/CyanogenMod/android_device_samsung_galaxys2
http://github.com/CyanogenMod/android_device_samsung_i777
Kernel:
https://github.com/teamhacksung/android_kernel_samsung_smdk4210
Build:
http://teamhacksung.org/wiki/index.php/CyanogenMod9:SGH-I777:How_to_build
Getting Started:
http://wiki.cyanogenmod.com/wiki/Howto:_Gerrit
Example:
- cd ~/android/system
- repo start branchname CyanogenMod/android_device_samsung_i777 (or android_device_galaxys2 depending on whether your work is in common galaxys2 or i777)
-- Make your changes at device/samsung/i777 (or galaxys2)
- cd device/samsung/i777 (or galaxys2)
- git add -A
- git commit -a
- cd ~/android/system
- repo upload CyanogenMod/android_device_samsung_i777 (or android_device_samsung_galaxys2 if your changes are to galaxys2)
Many of your changes will actually be in the android_device_samsung_galaxys2 repo as well as the code is shared between the galaxys2 and i777 so you will also need to work in that repo.
Navigate to http://review.cyanogenmod.com , click your commit and add atinm for i777, atinm, codeworkx and xplodwild for galaxys2, as reviewers.
Saved for later.
Alright, this thread has been cleaned up to here. All other non-dev members can discuss this here in the designated discussion thread in the General forum.
atinm - don't know if you saw, but there's a pending gerrit submission for an updated kernel.
The current set of kernels has ondemand as default but interactive governor enabled - this combo can cause hung task freezes in LPM and recovery.
http://review.cyanogenmod.com/#change,14072
(I tried to add you as a reviewer but I'm not sure if that's the correct atinm. The system is full of "use the other atinm" users. )
Entropy512 said:
atinm - don't know if you saw, but there's a pending gerrit submission for an updated kernel.
The current set of kernels has ondemand as default but interactive governor enabled - this combo can cause hung task freezes in LPM and recovery.
http://review.cyanogenmod.com/#change,14072
(I tried to add you as a reviewer but I'm not sure if that's the correct atinm. The system is full of "use the other atinm" users. )
Click to expand...
Click to collapse
Saw this too late - I pushed the same kernel plus an added assert for galaxys2 so people using the bad ported galaxys2 builds can get to i777. I'll take out the galaxys2 assert in a couple of days after people are on i777. Building a new nightly.
Will look at the GPS you have on gerrit in a little bit - have to be out for a few hours.
Building from source
I am trying to build it locally with following error:
Code:
[email protected]:~/android/system$ brunch i777
---//some skipped output///---
build/core/product_config.mk:189: *** _nic.PRODUCTS.[[device/*/i777/cm.mk]]: "vendor/samsung/i777/i777-vendor-blobs.mk" does not exist. Stop.
** Don't have a product spec for: 'cm_i777'
** Do you have the right repo manifest?
My manifest:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<manifest>
<project name="CyanogenMod/android_device_samsung_galaxys2" path="device/samsung/galaxys2" remote="github" />
<project name="CyanogenMod/android_device_samsung_i777" path="device/samsung/i777" remote="github" />
<project name="teamhacksung/android_kernel_samsung_smdk4210" path="kernel/samsung/smdk4210" remote="github" revision="ics" />
<project name="teamhacksung/buildscripts" path="buildscripts" remote="github" revision="ics">
<copyfile dest="build.sh" src="samsung/build.sh" />
</project>
<project name="CyanogenMod/android_packages_apps_SamsungServiceMode" path="packages/apps/SamsungServiceMode" remote="github" />
</manifest>
Any help is greatly appreciated!
you didn't do extract-files
Not sure if looking for galaxys2 will cut it... Most likely a bunch of people are coming from Touchwiz-based firmwares.
I admit I am partially at fault - I didn't implement sed scripts in Hellraiser to change the model, partly to minimize the chances that something would break. (The rule was to change as little as possible to make things work in order to maximize compatibility.)
sam3000 said:
I had that too (link). As a workaround, edit device/samsung/i777/extract-files.sh and change DEVICE=galaxys2 to DEVICE=i777 and it should build. I'm not sure what the correct fix should be though..
The other stuff I mention in the linked post has since been fixed.
Click to expand...
Click to collapse
The issue is that the proprietary files that the i777 is using are from the galaxys2 and it just pulls them from there. But the .mk files that are generated need to go into the i777 directory. I've updated extract-files.sh to try to get around it, but need someone to test.
atinm said:
The issue is that the proprietary files that the i777 is using are from the galaxys2 and it just pulls them from there. But the .mk files that are generated need to go into the i777 directory. I've updated extract-files.sh to try to get around it, but need someone to test.
Click to expand...
Click to collapse
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
5942marine said:
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
Click to expand...
Click to collapse
Did you enable root for adb before running extract-files.sh? And what ROM do you have now?
I had cm7 on it when I ran the extract, I just did it on that phone bricker build as well, only ended up missing one *.so, cant remember which exact file it was, had to step away. Will get back in the am.
Sent from my SGH-I777 using XDA
Update: Just flashed atinm's nightly of CM9, ran extract_files.sh and no errors at all.
5942marine said:
I tried to run extract-files.sh and got:
Code:
remote object '/system/lib/libGLESv2_dbg.so' does not exist
Which gave me this during compile:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/libGLESv2_dbg.so', needed by `out/target/product/i777/system/lib/libGLESv2_dbg.so'. Stop.
I have the latest repo as describe in the op. Anyone else run into this issue? Ran the extract on cm7.
Click to expand...
Click to collapse
5942marine said:
I had cm7 on it when I ran the extract, I just did it on that phone bricker build as well, only ended up missing one *.so, cant remember which exact file it was, had to step away. Will get back in the am.
Sent from my SGH-I777 using XDA
Update: Just flashed atinm's nightly of CM9, ran extract_files.sh and no errors at all.
Click to expand...
Click to collapse
Confirmed, /system/lib/libGLESv2_dbg.so does not exist in CM7 so of course it can't be extracted. Screencap of partial file list from my last nandroid on CM7 before upgrading attached.
All non-dev related posts have been moved over to the General CM9 thread.
I guess the giant red bolded DEV tag at the top isnt obvious enough.
Just an update... I was compiling the latest build, and got the following error:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/hwcomposer/lib/libfimc.so', needed by `out/target/product/i777/obj/lib/libfimc.so'. Stop.
Now, when i ran ./extract-files, I didn't recieve any errors while it was pulling the files.
I can see that the file is in the galaxy2-common directory, under the proprietary folder.
There is not folder under proprietary /hwcomposer/lib
5942marine said:
Just an update... I was compiling the latest build, and got the following error:
Code:
make: *** No rule to make target `vendor/samsung/galaxys2-common/proprietary/hwcomposer/lib/libfimc.so', needed by `out/target/product/i777/obj/lib/libfimc.so'. Stop.
Now, when i ran ./extract-files, I didn't recieve any errors while it was pulling the files.
I can see that the file is in the galaxy2-common directory, under the proprietary folder.
There is not folder under proprietary /hwcomposer/lib
Click to expand...
Click to collapse
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Posts cleaned out again. Im only going to say this one last time...
THIS THREAD IS FOR DEVELOPMENT ONLY. IF YOU ARE NOT HELPING DEVELOP FOR CM9 THEN YOU SHOULD POST IN THE GENERAL THREAD, NOT THIS THREAD. ANY FURTHER NON-DEV RELATED POSTS WILL RECEIVE AN AUTOMATIC INFRACTION AND THEIR POST WILL BE DELETED.
sam3000 said:
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Click to expand...
Click to collapse
Thanks, got it working.
sam3000 said:
This is the fix for the same issue that was present in galaxys2:
http://review.cyanogenmod.com/#change,13935
Click to expand...
Click to collapse
http://review.cyanogenmod.com/#change,14155 fixes the same thing for i777.
5942marine said:
Thanks, got it working.
Click to expand...
Click to collapse
Any extract-files.sh fixes you make - please gerrit them, or just send them to me directly via email if you don't know gerrit (learn Gerrit if you intend to develop for CM!).
Red5 said:
All non-dev related posts have been moved over to the General CM9 thread.
I guess the giant red bolded DEV tag at the top isnt obvious enough.
Click to expand...
Click to collapse
Can you clarify - I take it discussion about build issues that are because script fixups are necessary in github sources is also off-limits ? ie where the root issue is in the repo not the person trying to compile. (Previous post removal implies this.)
If someone can't massage whatever comes out of github in order to get it to compile then it's unlikely they would be posting patches even if the build worked. However, on the other hand, I would argue it's also useful to identify, discuss and fix any build related issues for the benefit of all (separate thread perhaps?)

[TOOL] Repo Update Tool

Dev's,
This is for those of you that build ROM's from source code and have forked repo's from the main line so you can make changes for your specific device i.e. android_framworks_base. These mini scripts will allow for the following
1. Download your local repo's and add a git remote back to the fork so you can fetch the updated head's
2. Fetch the heads as you see fit
3. Copy the updated source into your local source build folder after a $repo sync
4. Push back up the changes after the ROM has been tested
There is full set of instructions at the following location.
https://github.com/g60madman/repo_update_tool
These mini scripts can be edited for all flavors of source code be it AOSP, AOKP, CM, or whatever; along with any repo structure github, google, bitbucket etc..
Enjoy!

[HELP]Cherry pick from local source

Hi, I wanted to build a CM12 kernel. I used CM kernel source and built a basic one that booted. Now i want to add features. I referred to guides and understand how to cherrypick using commits but instead of doing git fetch, I git cloned it. Now i have a folder of my kernel and other kernel. How do i cherrypick from that folder into my kernel?

Errors syncing Cyanogenmod source and building rom.

I am trying to follow this guide:
Code:
https://wiki.cyanogenmod.org/w/Build_for_h901#What_you.E2.80.99ll_need
in order to build cyanogenmod for my H901, but after the initial repo sync "completed" without error, i follow the guide through breakfast and the the file extraction, and brunch fails to build all targets. after this, doing repo sync again gives me this:
Code:
Fetching projects: 99% (524/529) Fetching project CyanogenMod/android_hardware_qcom_display
Fetching project CyanogenMod/android_hardware_qcom_display
Fetching project CyanogenMod/android_hardware_qcom_display
fatal: Couldn't find remote ref refs/heads/cm-13.0
error: Cannot fetch CyanogenMod/android_kernel_lge_pplus
error: Exited sync due to fetch errors
I want to say this is due to the v10 not being a "supported device" for CM13 yet, as it is not listed on the lunch menu. but i was running the test builds in the dev section just fine, and i'm sure it's a fairly simple matter to pull the right stuff from git, but i'm a newbie to this kind of development.
After successfully building from source, i want to build a custom rom based on CM13 and keep the LG stock camera app, and the LGSignboard second screen function, and gain all the Cyanogenmod goodies too. any help or guidance with that quest would be appreciated.
I really hope someone can answer this for you.. :/
I think, you are trying to sync cm-13.0 branch of cyanogenmod lge_pplus kernel repo in your local manifest. But this is not there. Its only the cm-12.1 branch there: https://github.com/CyanogenMod/android_kernel_lge_pplus. For cm-13 you will need a different kernel source path. Hopefully there are already cm-13 roms for your device and with sources on github, where from you can sync?
Okay, that makes sense.
I was following a guide on CM wiki to build CM13 for the v10, why would that branch not be present on github if there is a guide to build from it?
I'll poke around github and xda for available kernel source.
Sent from my LG-H901 using XDA-Developers mobile app

GIT 101 - Newbie Friendly

Hello,
Today I would like to share an easy git tutorial for all of you. We at XDA believe everyone loving Android and passionate about the same can contribute something or other to the community. Not everyone is an expert at everything like theming, bootanimations, building ROMs, Kernels etc etc. But git is an essential yet powerful tool in most aspects. This thread is for new users and old alike , wanting a correct direction of learning basic Android by starting with git. Okay enough of lectures? Bwahaha I know it's boring lol
So let's start
Gitlab? What exactly it is? How is it different from github?
GitLab is an application to code, test, and deploy code together. It provides Git repository management with fine grained access controls, code reviews, issue tracking, activity feeds, wikis, and continuous integration. Inshort and in simple english, it is a place to store all your sources, it maybe private, public or restricted.
Difference : GitHub is a publicly available, free service which requires all code (unless you have a paid account) be made open.GitHub currently hosts the source code for tens of thousands of open source projects. GitLab is a github like service that organizations can use to provide internal management of git repositories.
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Signing up, Creating an account and setting up git
Go to gitlab web
You have an option to sign in with google, github, twitter or bitbucket. It's the easiest way. I prefer github
Now let's download the git package. I use Linux Mint 18 so,
Code:
sudo apt-get install git
Verify if it is correctly installed in your system
.
Now let's configure the terminal
Code:
git config --global user.name "Your Name Here"
git config --global user.email "[email protected]"
Now let's generate ssh keys
go to your terminal and type
Code:
ssh-keygen
and hit enter thrice I guess until you are back to bash.
Or
Code:
ssh-keygen -t rsa -C "[email protected]"
Now
Code:
cd .ssh
cat id_rsa.pub
(.pub is your public key while the other one is private key, Don't ever share private keys with anyone)
Now let's verify all that we've done so far.
Code:
git config --global --list
Now let's add ssh-keys we generated to our account at gitlabs OR we get this
Click : Add an ssh key and copy paste the ssh-key (id_rsa.pub) there and click okay.
Now let's check if everything works
Code:
ssh -T [email protected]
This warning...
Code:
The authenticity of host 'github.com (207.97.227.239)' can't be established.
# RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
# Are you sure you want to continue connecting (yes/no)?
Type YES and here we're done with configuration part
XDA:DevDB Information
GIT 101, Tool/Utility for the Samsung Galaxy Chat
Contributors
Vatsal, malybru, sawdoctor
Version Information
Status: Testing
Created 2016-12-09
Last Updated 2016-12-20
XDA:DevDB Information
GIT 101 - Newbie Friendly, ROM for the Android General
Contributors
The Arrow
ROM OS Version: 2.3.x Gingerbread
Version Information
Status: Testing
Created 2018-04-25
Last Updated 2018-04-25
Now let's start with creating a new repo and importing it from github (If you are a previous github user and want to switch to gitlabs)
Just click new project button and you'll have this
And I click import the project with github and I choose the project I wish to import
And I have this :
Please be patient and grab some coffee?
It will import the entire project with all the branches.
And it's done..
Now let's clone the project locally to make changes. We can make the changes on web too but well it's really a mess so most people prefer CLI way.
Click the copy to clipboard button as in screenshot
and clone it locally.
Command :
Code:
git clone <Paste the URL copied> -b <branch name>
Note : the default branch is cloned with you clone with .git
Wait for it to finish and get back to bash done.
Now we have the repo locally. Now we go to the repo to check the files and edit as we wish.
First we grab the latest changes from the original repo to check if we have latest changes.
Code:
Example : the repo I am cloning is forked on my github and I imported from there to gitlabs.
The original repo is here https://github.com/CyanogenMod/android_device_xiaomi_hydrogen.
So I make sure I have the latest changes.
To get the latest changes, I use
Code:
git pull <original repo URL> <branch name>
So here, I am pulling from the CM repo I mentioned above and cm-14.1 branch.
Now I just edit something and make change so as to commit it.
So I just deleted the cm.dependencies file from the repo.
Now we
Code:
git add -A
to add the untracked changes.
A more detailed info is here
The important point about git add . is that it looks at the working tree and adds all those paths to the staged changes if they are either changed or are new and not ignored, it does not stage any 'rm' actions.
git add -u looks at all the already tracked files and stages the changes to those files if they are different or if they have been removed. It does not add any new files, it only stages changes to already tracked files.
git add -A is a handy shortcut for doing both of those.
So let's commit now by using
Code:
git commit
and we get this
Write the commit name (Any you like). Now save and exit and we have this
Now let's learn further about
Code:
git status
.
Just as the name suggests, it tell us the status of the particular repo.
It displays the path and difference between cloned repo and the orginal repo.
DESCRIPTION
Displays paths that have differences between the index file and the current HEAD commit, paths that have differences between the working tree and the index file, and paths in the working tree that are not tracked by Git (and are not ignored by gitignore[5]). The first are what you would commit by running git commit; the second and third are what you could commit by running git add before running git commit.
Now it's time to push the changes we made to the gitlabs repo.
Calm down! It is no rocket science. Infact the easiest part.
Command :
Code:
git push <URL of the repo> HEAD:<branch name>
Enter your username and password correctly.
And pushed...
And now let's check at gitlabs if it is successfully pushed.
Done :victory:
So now we learnt pull, push, status. We proceed with The most important command
Code:
cherry-pick
{Most of the people might have heard of it, and wonder what it is?}
Cherry picking in Git is designed to apply some commit from one branch into another branch, one repo into another
Given one or more existing commits, apply the change each one introduces, recording a new commit for each. This requires your working tree to be clean (no modifications from the HEAD commit).
When it is not obvious how to apply a change, the following happens:
The current branch and HEAD pointer stay at the last commit successfully made.
The CHERRY_PICK_HEAD ref is set to point at the commit that introduced the change that is difficult to apply.
Paths in which the change applied cleanly are updated both in the index file and in your working tree.
For conflicting paths, the index file records up to three versions, as described in the "TRUE MERGE" section of git-merge[1]. The working tree files will include a description of the conflict bracketed by the usual conflict markers <<<<<<< and >>>>>>>.
No other modifications are made.
So I would wish to cherry-pick a particular commit on the same repo we have been working upon.
This is the commit I want to pick in my repo.
For cherry-picking, first we need to learn
Code:
git fetch
What does git fetch do?
git fetch - Download objects and refs from another repository
Command :
Code:
git fetch <URL> <Branch>
Fetch branches and/or tags (collectively, "refs") from one or more other repositories, along with the objects necessary to complete their histories. Remote-tracking branches are updated (see the description of <refspec> below for ways to control this behavior).
By default, any tag that points into the histories being fetched is also fetched; the effect is to fetch tags that point at branches that you are interested in. This default behavior can be changed by using the --tags or --no-tags options or by configuring remote.<name>.tagOpt. By using a refspec that fetches tags explicitly, you can fetch tags that do not point into branches you are interested in as well.
git fetch can fetch from either a single named repository or URL, or from several repositories at once if <group> is given and there is a remotes.<group> entry in the configuration file.
When no remote is specified, by default the origin remote will be used, unless there’s an upstream branch configured for the current branch.
So we fetch it from the AICP github with branch name n7.1
and then we cherry-pick it by using
Code:
git cherry-pick <commit ID>
and now it's cherry-picked. We have that commit in our repo.
Note : This was an easy pick but most picks aren't this easy. We will learn about fixing conflicts later on
Now we push it to gitlabs repo.
and we'll check if our gitlabs repo has it now !?
Now we learn how to create a new branch and push to that branch.
We create a new branch by
Code:
git branch <new branch name>
This creates a new branch with the new branch name specified in the command.
Now we checkout the branch to switch to that particular branch.
Command :
Code:
git checkout <branch name>
git checkout <branch>
To prepare for working on <branch>, switch to it by updating the index and the files in the working tree, and by pointing HEAD at the branch. Local modifications to the files in the working tree are kept, so that they can be committed to the <branch>.
If <branch> is not found but there does exist a tracking branch in exactly one remote (call it <remote>) with a matching name, treat as equivalent to
Code:
git checkout -b <branch> --track <remote>/<branch>
You could omit <branch>, in which case the command degenerates to "check out the current branch", which is a glorified no-op with a rather expensive side-effects to show only the tracking information, if exists, for the current branch.
Now that we have successfully cherry-picked,
we will learn to show the commits logs in terminal itself (Not GUI).
Code:
git log
can help us with that.
We can also add a flag besides it for example 'git log -3' to see the last 3 commits.
Shows the commit logs.
The command takes options applicable to the git rev-list command to control what is shown and how, and options applicable to the git diff-* commands to control how the changes each commit introduces are shown.
Now we learn how to revert a cherry-pick ?
Well it's pretty easy.
So I grab the commit ID from the commit I wish to revert.
Here's the command
Code:
git revert <commit ID>
After reverting make sure to push it to the repo to see the revert there as well
Supposing we make a change to a repo and we don't wish to commit it. Instead we wish to reset the repo to the previous state,
Here is a ways we can do it.
Code:
git stash
It discards all the local changes and gets it back to the last commit.
Also suppose if we want to revert 20 odd commits and we have force push access (And you are lazy like me ), we don't revert it one by one. Instead we can just hard reset the repo to the last commit
Command :
Code:
git reset --hard <commit ID>
This is the easiest way to do it.
Now the last one. Force pushing
Sometimes github doesnt let us push after resetting hard because the previous commits dont exist in our repo.
We can just force push to force it accept the commits
Command :
Code:
git push -f <URL name> <branch name>
It is basically a noob method to just add changes easily after a failed or unsuccessful push.
Credits
- @malybru , @sawdoctor for always being there for me.
- @eagleeyetom , @Neo , @Perseus , @Darth , @KennyG123 , @The Merovingian for a lot of things (Will fill up pages if I start writing ).
- The entire XDA Staff
- @TechExhibeo and @@jackeagle for helping me through my noob days
- Gitlab ofcourse
-GZR Team for not killing me when I asked a lot of stupid questions.
- Legacy Team for guiding me through lot of stuffs.
- Everyone, that I forgot to mention.
And this too. Moar spams incoming..
Great Help for Newbies
Thanks Vatsal Sir _/|\_
This will be very helpful for Newbies learning stuffs.
Great Work :*
-TechExhibeo
Wonderful Guide and great work @Vatsal ! This will help newbies a lot Every aspect of git is mentioned in 1 Guide Keep up the spirit sir!
Cheers!
jackeagle
Forum Moderator
Nicely written
Nias works
Well tutorial
Thanks for this Tut!
Would be my Git Reference *bookmarks*
Good work mate!
A great help to newbies
Arvind7352 said:
Thanks for this Tut!
Would be my Git Reference *bookmarks*
Click to expand...
Click to collapse
This is a little more than a tutorial, if members are having trouble learning git they can ask here and will get actuall help rather than being told to read
Sent from my SM-N930F using Tapatalk
I will be available to answer in whatever capacity I can as well. There are many of you however that are far beyond my knowledge of git though
I'm sure I'll be learning something
Thanks for such a wonderful guide
Thanks for the guide vatsal
Nice...finally got something to learn.thank @Vatsal
Neo said:
I will be available to answer in whatever capacity I can as well. There are many of you however that are far beyond my knowledge of git though [emoji14]
I'm sure I'll be learning something
Click to expand...
Click to collapse
Thanks for your support for this project. I know I speak for Malybru and vatsal as well it means a lot that you are on board [emoji106] [emoji106]
Sent from my SM-N930F using Tapatalk
Excellent resource! Kudos for this. :good::highfive:

Categories

Resources