Pages

Monday, October 29, 2012

Adding local git repository to remote server

When you have a remote repository in bitbucket, you need to push the local repository for the first time.
You can use git remote add "BRANCH", to add the branch, and then push it.
git remote add origin ssh://git@bitbucket.org/smcho/refactoringvalidatorpaper.git
git push -u origin master   # to push changes for the first time

After this, you'll find that the config file in .git has the new section.
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	url = ssh://git@bitbucket.org/smcho/refactoringvalidatorpaper.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
	remote = origin
	merge = refs/heads/master

No comments:

Post a Comment