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

Thursday, 2 January 2014

how to pull from an existing git repository

how to start from scratch by pulling branches from an existing git repository
 
mkdir /path/to/your/project 
cd /path/to/your/project 
git init 
git remote add origin ssh://git@bitbucket.org/username/bbreponame.git
 
 
Then check out as local branches
git checkout -b LocalName origin/remotebranchname 

Wednesday, 4 September 2013

changing git remote url


Go the project folder for example:

cd /home/vickrant/project1

then edit the git config file like:

sudo vim .git/config

In this file you can change the url to whatever repository you like to change it to. Save and close the file. Now you can do git pull from the new URL.

[core]
        repositoryformatversion = 0
        filemode = true
        bare = false
        logallrefupdates = true
[remote "origin"]
        url = https://vickrantearnest@bitbucket.org/project1.git
        fetch = +refs/heads/*:refs/remotes/origin/*
[branch "develop"]
        remote = origin
        merge = refs/heads/develop
[branch "master"]
        remote = origin
        merge = refs/heads/master