Git is an open source version control system to handle programming projects which involve numerous programmers, because it offers the function where we can synchronize the codes, as well as revert to previous version of coding when the current one is not right. Git is command based program but it is easy to learn and use.

Where can I get Git?

https://git-scm.com/downloads

How to use (push) upload files to GitHub?

(I am using Windows 64-bit version)

Task: Create a private repository on GitHub and invite other programmers as collaborators.

  1. Change directory to the folder that you want to work on. “cd” to change the directory (folder).
  2. Initialize git at the working folder using command “git init”.
  3. We can check the status of git using command “git status”. Status shows that currently I am working on “branch master”, and there is no “commits” yet. In Git, we can create branch to separate the tasks or portion of the projects, usually master branch is the one we will official deploy it to server, while sub-branches are created and we work on that. Commit is a command to record the codes that we have done so far.
  4. Add all files in the working folder into track, “git add .”
  5. git commit -m [message]
  6. git remote add [origin] [link]
  7. git push [origin] [master]

On GitHub

Other useful command

  • git branch
  • git log
  • git diff
  • git checkout -b
  • git checkout
  • git reset

Leave a Reply

Your email address will not be published. Required fields are marked *