My Git Commands Usefull-Modified

You might also like

Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 2

***********************************************************************************

***********************************
http://source.android.com/source/developing.html

http://source.android.com/source/life-of-a-patch.html

http://source.android.com/source/submit-patches.html

http://www.mediawiki.org/wiki/Gerrit/Advanced_usage

http://www.siteground.com/tutorials/git/commands.htm

http://git-scm.com/docs/git-add

***********************************************************************************
***********************************

>> repo init --manifest-url= .... --repo-url= ....... --manifest-branch=branch name

>> repo sync // to sync the complete source of branches.

>> repo sync -c -j4 // to sync just the branch files and fast

>> git init // run this inside the project directory ; to have the empty repository
initialized.

>> git branch -a // to see available branches

>> git status // to view the list of modified files. Also to see the state of the
branch.

>> git add -A // to add the modifed files into local repo for index list which
are required to be pushed on to server.

>> git add <file name> from index

>> git commit -s // below details will be shown // to commit the files so as to
push to server with commit id

>> git commit --amend // When you upload the amended patch, it will replace the
original on gerrit and in your local git history.

>> git checkout filename // (to discard changes in working directory if any)

>> git rm <file name> // for index and repository

>> git log

>> git show <commit-id>

>> repo upload // tp push the committed files from local repository to server.

>> git push origin

***********************************************************************************
*******************
***********************************************************************************
*******************

>> repo sync // Resolving sync conflicts


If other patches are submitted to the source tree that conflict with
yours, you will need to rebase your patch on top of the new HEAD of
the source repository. The easy way to do this is to run
This command first fetches the updates from the source server, then
attempts to automatically rebase your HEAD onto the new remote
HEAD.

>> git rebase master // If the automatic rebase is unsuccessful, you will have to
perform a manual rebase.

>> git clone git://github.com/schacon/grit.git

That creates a directory named grit, initializes a .git directory inside it, pulls
down all the data for that repository, and checks out a working copy of the latest
version. If you go into the new grit directory, you’ll see the project files in
there, ready to be worked on or used.

>> git clone git://github.com/schacon/grit.git mygrit

That command does the same thing as the previous one, but the target
directory is called mygrit.

You might also like