Using git to put a project into a repository

I have a new project in Eclipse in the directory ProjectDirectory which contains the src, lib, etc. folders. Note that this project has never before communicated with any repository.

I have a git repository with a username user and a password pass (note that this is fake info). In that repository, I currently have some files.

  • SVN blame in Eclipse
  • which eclipse project/workspace files should be added to source control?
  • Eclipse shows error when there are none
  • How to use Egit with ssh
  • How to resolve tree conflicts through svn Eclipse plugin
  • Adding a SVN repository in Eclipse
  • I want to do the following.

    1. Remove ALL the current contents in the git repository
    2. Add the new contents from my Eclipse project into this repository. This should result in no conflicts or no errors whatsoever, since I want to completely replace the current repository with these files.

    With specific instructions, what set of commands in the terminal would I write to accomplish this?

  • git credneital-manager-st is not a git command on Windows 10
  • restore windows command prompt tools after git bash replace them with unix tools
  • Go get from private git repository fails due to .git in url
  • Unable to show a Git tree in terminal
  • Ignore *all* whitespace changes with git-diff between commits
  • Cannot push my ruby app to heroku
  • One Solution collect form web for “Using git to put a project into a repository”

    Its fully simple. First go into the directory in terminal where the eclipse project is.

    To start putting this under version managment:

    git init

    Then add the origin as the git repo ( copy your ssh read+write access from github, this you see when you are loggin in on github and navigates to the actual repositorys directory ):

    git remote add origin <copied_adress_from_github>

    So now in the last step you will need to overwrite forced the remote repo with:

    git push -f origin master

    You can start commiting, making branches etc… However if on the remote repo there was other branches you want to remove them with:

    git push origin --delete <branch_name>
    Git Baby is a git and github fan, let's start git clone.