How to Migrate Android Source Code from Stash to BBKT TST
Summary
Current location of Android Source Code
ESSBitBucket repository link is,
Download git client
BBKT User Settings
xu75143@7MYSERVERBBT0 /cygdrive/c/Users/xu75143/myandroid/android
$ git config --global user.name "First Last"
xu75143@7MYSERVERBBT0 /cygdrive/c/Users/xu75143/myandroid/android
$ git config --global user.email ""
SSH Keys
$ ssh-keygen -t rsa -C ""
Generating public/private rsa key pair.
Enter file in which to save the key (/home/xu75143/.ssh/id_rsa): /home/xu75143/.ssh/id_rsa_first_last
Created directory '/home/xu75143/.ssh'.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/xu75143/.ssh/id_rsa_first_last.
Your public key has been saved in /home/xu75143/.ssh/id_rsa_first_last.pub.
The key fingerprint is:
SHA256:EQV0ewKH4XNPqNjvPl+GkDIZIdharOFUkzvyEZQbu5s
The key's randomart image is:
+---[RSA 2048]----+
| *=+B=+ |
| + O+.* o |
| o = *= = o |
| = *o B * |
| o.+S o . |
| o + . . |
| o . . o |
| E .. o |
| .oo. |
+----[SHA256]-----+
Upload into BBKT
Copy and Paste the .pub file
How to clone Android.git
- Download git client or source tree or Cygwin with git
- Mkdir c:\myandroid
- Cd myandroid and ‘git clone
$ git clone
Cloning into 'android'...
remote: Counting objects: 6692, done.
remote: Compressing objects: 100% (3815/3815), done.
remote: Total 6692 (delta 3437), reused 5967 (delta 2762)
Receiving objects: 100% (6692/6692), 21.55 MiB | 2.06 MiB/s, done.
Resolving deltas: 100% (3437/3437), done.
Making Code Changes
cd existing-project
git init
git add --all
git commit -m "Initial Commit"
git remote add origin
git push -u origin master
Create a new branch
Git checkout –b MYBRANCH
$ git push --set-upstream origin EPIC_SONARCounting objects: 5182, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (3266/3266), done.
Writing objects: 100% (5182/5182), 20.74 MiB | 162.00 KiB/s, done.
Total 5182 (delta 2298), reused 3879 (delta 1844)
remote:
remote: Create pull request for EPIC_SONAR:
remote:
remote:
To
* [new branch] EPIC_SONAR -> EPIC_SONAR
Branch EPIC_SONAR set up to track remote branch EPIC_SONAR from origin.
Set Remote Upstream URL
cd existing-project
git remote set-url origin
git push -u origin master
GIT COMMANDS CHEAT SHEET
git init
<directory>
git clone <repo>
git config
user.name <name>
git add
<directory>
git commit -m
"<message>"
git status
git log
git diff
Create empty Git repo in specified directory. Run with no arguments to
initialize the current directory as a git repository.
Clone repo located at <repo> onto local machine. Original repo can be
located on the local filesystem or on a remote machine via HTTP or SSH.
Define author name to be used for all commits in current repo. Devs
commonly use --global flag to set config options for current user.
Stage all changes in <directory> for the next commit. Replace <directory>
with a <file> to change a specific file.
Commit the staged snapshot, but instead of launching a text editor, use
<message> as the commit message.
List which files are staged, unstaged, and untracked.
Display the entire commit history using the default format. For
customization see additional options.
Show unstaged changes between your index and working
directory
Create new commit that undoes all of the changes made in
<commit>, then apply it to the current branch.
git revert
<commit>
Remove <file> from the staging area, but leave the working directory
git reset <file> unchanged. This unstages a file without overwriting any changes.
Shows which files would be removed from working directory. Use the -f
flag in place of the -n flag to execute the clean.
git clean -n
+
Git Branches
Remote Repositories
Rewriting Git History
Replace the last commit with the staged changes and last commit
combined. Use with nothing staged to edit the last commit’s message.
git commit --amend
Rebase the current branch onto <base>. <base> can be a commit
ID, a branch name, a tag, or a relative reference to HEAD.
git rebase <base>
Show a log of changes to the local repository's HEAD. Add --relativedate
flag to show date info or --all to show all refs.
git reflog
List all of the branches in your repo. Add a <branch> argument to
create a new branch with the name <branch>.
git branch
Create and check out a new branch named <branch>. Drop the -b
flag to checkout an existing branch.
git checkout -b
<branch>
git merge <branch> Merge <branch> into the current branch.
Create a new connection to a remote repo. After adding a remote, you
can use <name> as a shortcut for <url> in other commands.
git remote add
<name> <url>
Fetches a specific <branch>, from the repo. Leave off <branch> to
fetch all remote refs.
git fetch
<remote> <branch>
Fetch the specified remote’s copy of current branch and immediately
merge it into the local copy.
git pull <remote>
Push the branch to <remote>, along with necessary commits and
objects. Creates named branch in the remote repo if it doesn’t exist.