Friday 5 December 2014

Convert existing non-empty directory into a Git working directory



How to convert existing non-empty directory into a Git working directory
1) Initialised existing directory with git
git init
2) add all untracked file to git for tracking changes
git add .
3) commit all changes
git commit -m 'message'
4) Add origin where you want to push changes. (i.e path of your online repository) git remote add origin <url>


5) Push files to a remote repository
git push -u origin master

Extra Notes:
1) To remove existing origin
git remote rm origin

2) pull from remote

git pull <URL>

3) push into remote( for push, you need to write access for remote)

git push --repo <URL>

4) URL is in general
https://github.com/username/repo.git

1 comment:

  1. Hi @Sambhaji Kolate

    I want to deploy my developed apps from local to server.

    Are there any predefined steps.

    ReplyDelete