9 Github workflow - GiovanniKaaijk/project-tech GitHub Wiki

Git

What is Git?

Git is a version control where developers can work together, Git is useful to because it saves every version of your code, when you break something, you can reset it. Also Github has some useful functions, you can create branches, issues and pull requests. I found branches the most useful of them all, you can create a branch which copies the latest version of the code into another branch. In this branch you can edit the code without affecting the main branch. When you finished the feature of the branche you can merge it back into the main branch.

Functions Github

Github brings the following functions:

  • Branches (create different branches of the code and bring them back together later)
  • Issues (report bugs in the project)
  • Projects (Trello board -> to do, in progress, done)
  • Wiki (documentation)
  • Pull requests (ask other users to review your code, if you get green light -> merge it into the main branch)

Functions Git

Git brings the following functions:

  • Commit (upload a new version of your code)
  • Push (push your code to Github)
  • Fetch (reload your local Git, see if anyone else made changes in the Github directory)
  • Pull (download the code from Github to your local Git folder)
  • Clone (clone a project from Github into your folder)

How do i use Git?

When i made changes in my folder, i check what files i changed by using git status. When i want to commit all files i use git add ., when i only want to want to add a certain file i use git add thefilename.js. If i make any mistake by doing this i use git reset, clearing the list of files to commit.

When i added every file i want to commit i use git commit -m "commit message", where -m stands for message. After i made a commit i use git push to push my code to Github