- Open Git Shell
- Change to other directory if need (cd "..\Visual Studio 2012\Projects\DisplayRSSFeeds")
- Add .gitignore
- Add readme.txt (optional)
- Initialize empty git repository: git init
- Add the existing files to the repository: git add .
- Commit the files: git commit -m "First commit" or git commit -a
- Log into Bitbucket.
- Create a new repository.
- Add a new remote: git remote add origin-bb https://yourusername@bitbucket.org/yourusername/yourgit.git
(Note: See picture below. You cannot push or remove the remote origin, so just make a new one called origin-bb as I did). - Push up the repo for the first time: git push -u origin-bb --all
Other git commands
# view current remote
git remote -v
# remove remote
git remote rm origin-bb
# Use these sequence git commands to update Git repository in both local and remote later.
git add .
git commit -a
git push -u
Further reading:
https://confluence.atlassian.com/display/BITBUCKET/Import+code+from+an+existing+project
http://git-scm.com/book/ch2-5.html




No comments:
Post a Comment