Github crashcourse

  1. When creating a new Repository remember to tick the box to add an initial README file, this makes things easier to setup.
  2. On a terminal of your choice, choose a folder, then:
  1. Go inside the folder of your Repository. (Windows: Shift Right-Click within a folder and choose open terminal or PowerShell)
  2. Check the Status to see information such as what branch you’re currently on: git status
  3. Make sure you are on the right branch before anything else, check the status.
  4. The next step is to choose what files will go in the commit.
  5. git add FileName, i.e: git add index.html - do this if you want to add a specific file, otherwise:git add -A or git add . to add all of the files of the current directory, this will compare all of the files from the current repository against the branch selected and add the files that have been changed.
  6. git commit -m "Write your commit message here" - The commit message should be very short and should be about the changes you've made to the code.
  7. You can commit multiple times but none of the changes will update the online repository until you have pushed them, to do that do: git push
  1. Make sure you got the latest version of the branch that you want to branch, either by clonning or by pulling the new changes (git pull).
  2. Do git branch to view existing branches and to verify what branch you're currently on as this will be the branch that will be branched.
  3. Do git branch NameOfTheBranch to create a branch.
git checkout NameOfTheBranchYouWantToSwitchTo

Workflow

git checkout SecondaryBranch
git add . git add readme.md
git commit -m "Made some changes to X Module"
git checkout master git pull
git checkout SecondaryBranch git merge MainBranch git push origin SecondaryBranch

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store