Giter Site home page Giter Site logo

demorepo's Introduction

demoRepo

These files are in markdown here are some links about the syntax: https://help.github.com/articles/markdown-basics/ https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

#git commands Adding to what was covered in the seminar

##add If all files in changes not staged (the red ones) are to be added. Use the command git add -A where A = all.

##Checkout Checkout can also be used to revert files to their state at last commit. git checkout [filename] This works until modified files have been added. I suggest that we use add when we have small changes to record. Then use commit and push when new features have been added, and at the end of coding sessions if there is only a single person working on the branch.

Another issue could be incomplete code due to interruptions. In this case:

  1. Create a new branch: git branch [branchName]
  2. Switch to new branch git checkout [branchName]
  3. Use the add and commit commands as usual
  4. There is a slight difference with pushing. The standard push command will fail as the branch doesn't exist on github at this time. The error message will show the correct code to enter. It will look like this: git push --set-upstream origin [branchName]
  • Checking out any other branches will update files to the versions committed in those branches. Just checkout branchName to get back to your latest version.
  1. Once the new branch has been completed. add, commit and push it.
  • Each branch will need to be pushed separately.
  1. Checkout to master (or parent branch) then merge the other branch in.

##Getting all branches By default git clone will only clone the current branch. It does have info about the other branches however. This is displayed the first time you pull the repo after branch is added.

  • Do git branch -a to see all branches (including remote)
  • Then git checkout -b localName origin/remoteName

Deleting branches

We probably won't be doing this much. Leaving them will be safer; but for reference:

Deleting locally

git branch -d branchName

Deleting remote

git push origin --delete [branchName]

patching files from another branch

How to fetch files from another branch, use when not suitable for a merge. Use this when the files exist on current branch. Gives a diff to before you merge git checkout --patch [branchName] [files] (files space separated) This command is used when the file doesn't exist in current branch (Or to overwrite?) git checkout [branchName] [files]

demorepo's People

Contributors

andrewstanton94 avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.