Showing posts with label git. Show all posts
Showing posts with label git. Show all posts

Wednesday, 8 June 2016

get latest code and rebase to local branch



> git branch

> git checkout develop

To fetch all remote branches.
> git fetch origin

To rebase local develop branch with remote develop branch.
> git rebase origin/develop

> git checkout <your branch>

to rebase local branch with develop branch
> git rebase develop


Thank You,
Uma Mahesh.







Tuesday, 7 June 2016

command to delete remote branch from git

Here is the command to delete branch from remote repo in git


> git push origin --delete <Branch name>


This will delete branch from local machine as well as remote repo.

Thank You,
Uma Mahesh.
 

Monday, 15 February 2016

Git push asking for username and password

When I try to push the code to github, I need to submit username and password every time. I keep on asking for username and password while pushing the code.

I came to see its due to ssh.

I have checked my remote config of my git repo and came to see it was with https

>    git remote –v
Now I removed the remote repo which is with https as below
>    git remote rm origin

Now I added the remote repo with git as below
>    git remote add origin git@github.com:umamahesh/sampleapp.git

Now authentication happens without ssh and with keys. You can push the code without username and password.

Thank You,
Uma Mahesh.

get code from remote branch in git

When you want to pull the branch code from same  repo, first navigate to main branch. Main branch is the reference branch.

>     git checkout master

From the main branch checkout to ‘develop’ branch. Develop branch is the name of the remote branch I am referring to.
>    git checkout develop
>    git pull origin develop
Now you will get the latest code from develop branch.

Below are the steps to merge the code from your branch to develop branch.

Let’s suppose you are working on the branch ‘uma-development’, Now you want to merge your code to ‘develop’ branch.

>    git checkout uma-development
>    git rebase develop

you may see many conflicts while doing the rebase. Try to solve conflicts one by one… after solving the conflicts, do git add
>    git add.
>    git rebase –continue

once your conflicts got resolved you are done with rebase. Now your branch ‘uma-development ‘ is up to date with develop branch code.

Now push the code to develop branch in remote and then raise pull request to develop branch.




Thanks,
Uma Mahesh.

Wednesday, 14 August 2013

git commands

Here are the list of useful git commands.

> git config -l

List all variables set in config file.

> git config --global user.name "uma mahesh"
> git config --global user.email "umamaheshvarma@gmail.com"



Thank You,
Uma Mahesh.
 

Monday, 22 October 2012

Git config commands



Below is the list of git global configuration commands

> git config -l

The above command will display complete configuration for the present git login as how below

user.name=Uma Mahesh
user.email=umamaheshvarma@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@heroku.com:umamahesh.git
branch.master.remote=origin
branch.master.merge=refs/heads/master





You can change the above configuration with the below commands,



git config --global user.email "
umamaheshvarma.seeram@gmail.com"
git config --global user.name "uma"







Thank You,
Uma Mahesh.



Wednesday, 5 September 2012

learn git in 15 minutes

Hi,

If you are new to git and git commands you can learn the git easily with try.github.com.

 



It provides a very good interface where you can type git commands and can learn the git easily.

I hope you know the advantage of git and how the web world is knocking it. So lets start learning git today.

URL: http://try.github.com/

Thank You,
Uma Mahesh.

Wednesday, 22 August 2012

Agent admitted failure to sign using the key. Permission denied (publickey).

Hi,

solution : ssh-add ~/.ssh/id_rsa


I have faced the below error while cloning the code from github. I have added my keys to heroku and every thing went good. But I am facing the below error

Agent admitted failure to sign using the key. Permission denied (publickey).

Cloning into master...
Agent admitted failure to sign using the key.
Permission denied (publickey).
fatal: The remote end hung up unexpectedly


Finally after google I found the solution as below

> ssh-add ~/.ssh/id_rsa

I have ran the above command and works for me.


Thank You,
Uma Mahesh.