Pergunta

I wanted to use a version-control system for some of my projects, so I made a Bitbucket account and downloaded Git and Sourcetree.

I have installed everything and everything works, but I'm not sure about a few things:

  1. Only way is to create a Rep. on Bitbucket and clone it on my PC? Isn't there a way to create the folder on my PC and "upload" it as a new repository to Bitbucket?

  2. What's the order? Should I push and commit, or should I commit and then push?(note that I'm the only one doing this)

  3. How can I link my Netbeans and VS projects? Do I have to manually drag the .cpp and .java files in my local repository folder?

Thanks for your time.

Foi útil?

Solução

It sounds like you need an introduction to git! There are a lot of good tutorials/how-to-learn on git, here are a couple of my favouite, especially for beginners.

http://think-like-a-git.net/

http://pcottle.github.io/learnGitBranching/

But, to answer your questions:

1) No, you must create a repo first, and then you can add files to the repo. The best way to go about this is create a repo, clone it, move files into that folder, commit the files, then push them. There is a way to initialize a git repo inside of an existing directory, but it's sort of a hassle to do it that way (a bit more complex). Cloning and moving will simplify things.

2) You need to commit to your changes before you push them! After you make a change, it isn't actually logged as being changed until you commit them to history (and the history is what determines what gets pushed to the repo)

3) I'd move the contents of your project folders into your cloned git repo, commit and push that.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top