Questions about using Git

2

I created a new project in Github and then tried to give git push to upload the files that were on my machine. I did the basic procedures needed (I think) to work, but it is giving% error of%.

I followed more or less this tutorial (from the 2nd step, the rest had already done).

Another thing I do not understand is the concepts of failed to push some refs , master and branches . I've looked this guide , but I'm still lost.

    
asked by anonymous 13.03.2014 / 18:20

2 answers

5

You must first pull the changes that other people have made (with git pull ), integrate them into your project, and then upload your changes (with git push ).

Another thing: this is true for Git, and not necessarily for Github hosting. It can also be Bitbucket or even an in-house solution.

About your questions about using Git, I recommend these two links:

  • link - an interactive tutorial on the most common Git commands, and
  • link - a document outlining various ways to work with Git, all very well explained!
13.03.2014 / 18:24
2

I recommend you read Git Guide . Some considerations:

  • You can create a local repository, and then add a source
  • You can clone a project

In the end the 2 above will give the same result.

After having a project, you need to version your code (your changes):

  • You have to add the files in the index of git , something like this:

    c:\>projeto\git add *
    
  • Give commit :

    c:\>projeto\git commit -m "Coisas que fiz no código"
    
  • At this moment your code is already versioned! But this versioning is local to send it to the server you have to make a push :

    c:\>projeto\git push origin master
    
  • 13.03.2014 / 18:37