Giter Site home page Giter Site logo

kingdom930414 / stevenscodes Goto Github PK

View Code? Open in Web Editor NEW

This project forked from master-alcy/stevenscodes

0.0 1.0 0.0 124.17 MB

Code for studying in Stevens

License: MIT License

OCaml 78.07% Makefile 0.36% Standard ML 0.10% JavaScript 8.43% CSS 0.23% HTML 1.02% Java 8.87% C++ 1.17% CMake 0.51% C 0.45% Assembly 0.08% Processing 0.72%

stevenscodes's Introduction

Note on git

Another cheatsheet on MarkDown Document
https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

CREATE

Clone an existing repository
$ git clone ssh://[email protected]/repo.git

Create a new local repository
$ git init

LOCAL CHANGES

Changed files in your working directory
$ git status

Changes to tracked files
$ git diff

Add all current changes to the next commit
$ git add .

Add some changes in to the next commit
$ git add -p

Commit all local changes in tracked files
$ git commit -a

Commit previously staged changes
$ git commit

Change the last commit Don‘t amend published commits!
$ git commit --amend

COMMIT HISTORY

Show all commits, starting with newest
$ git log

Show changes over time for a specific file
$ git log -p

Who changed what and when in
$ git blame

BRANCHES & TAGS

List all existing branches
$ git branch -av

Switch HEAD branch
$ git checkout

Create a new branch based on your current HEAD
$ git branch

Create a new tracking branch based on a remote branch
$ git checkout --track <remote/branch>

Delete a local branch
$ git branch -d

Mark the current commit with a tag
$ git tag

UPDATE & PUBLISH

List all currently configured remotes
$ git remote -v

Show information about a remote
$ git remote show

Add new remote repository, named
$ git remote add

Alle Änderungen von runterladen, aber nicht in HEAD integrieren
$ git fetch

Download changes and directly merge/integrate into HEAD
$ git pull

Publish local changes on a remote
$ git push

Delete a branch on the remote
$ git branch -dr <remote/branch>

Publish your tags
$ git push --tags

MERGE & REBASE

Merge into your current HEAD
$ git merge

Rebase your current HEAD onto Don‘t rebase published commits!
$ git rebase

Abort a rebase
$ git rebase --abort

Continue a rebase after resolving conflicts
$ git rebase --continue

Use your configured merge tool to solve conflicts
$ git mergetool

Use your editor to manually solve conflicts and (after resolving) mark file as resolved
$ git add $ git rm

UNDO

Discard all local changes in your working directory
$ git reset --hard HEAD

Discard local changes in a specific file
$ git checkout HEAD

Revert a commit (by producing a new commit with contrary changes)
$ git revert

Reset your HEAD pointer to a previous commit …and discard all changes since then
$ git reset --hard

…and preserve all changes as unstaged changes
$ git reset

…and preserve uncommitted local changes
$ git reset --keep

Version control

COMMIT RELATED CHANGES

A commit should be a wrapper for related changes. For example, fixing two different bugs should produce two separate commits. Small commits make it easier for other de- velopers to understand the changes and roll them back if something went wrong. With tools like the staging area and the abi- lity to stage only parts of a file, Git makes it easy to create very granular commits.

COMMIT OFTEN

Committing often keeps your commits small and, again, helps you commit only related changes. Moreover, it allows you to share your code more frequently with others. That way it‘s easier for everyone to integrate changes regularly and avoid having merge conflicts. Having few large commits and sharing them rarely, in contrast, makes it hard to solve conflicts.

DON‘T COMMIT HALF-DONE WORK

You should only commit code when it‘s com- pleted. This doesn‘t mean you have to complete a whole, large feature before committing. Quite the contrary: split the feature‘s implementation into logical chunks and remember to commit early and often. But don‘t commit just to have something in the repository before leaving the office at the end of the day. If you‘re tempted to commit just because you need a clean working copy (to check out a branch, pull in changes, etc.) consider using Git‘s «Stash» feature instead.

TEST CODE BEFORE YOU COMMIT

Resist the temptation to commit some- thing that you «think» is completed. Test it thoroughly to make sure it really is completed and has no side effects (as far as one can tell). While committing half-baked things in your local repository only requires you to forgive yourself, having your code tested is even more important when it comes to pushing/sharing your code with others.

WRITE GOOD COMMIT MESSAGES

Begin your message with a short summary of your changes (up to 50 characters as a gui- deline). Separate it from the following body by including a blank line. The body of your message should provide detailed answers to the following questions: › What was the motivation for the change? › How does it differ from the previous implementation? Use the imperative, present tense («change», not «changed» or «changes») to be consistent with generated messages from commands like git merge.

VERSION CONTROL IS NOT A BACKUP SYSTEM

Having your files backed up on a remote server is a nice side effect of having a version control system. But you should not use your VCS like it was a backup system. When doing version control, you should pay attention to committing semantically (see «related chan- ges») - you shouldn‘t just cram in files.

USE BRANCHES

Branching is one of Git‘s most powerful features - and this is not by accident: quick and easy branching was a central requirement from day one. Branches are the perfect tool to help you avoid mixing up different lines of development. You should use branches extensively in your development workflows: for new features, bug fixes, ideas…

AGREE ON A WORKFLOW

Git lets you pick from a lot of different work- flows: long-running branches, topic bran- ches, merge or rebase, git-flow… Which one you choose depends on a couple of factors: your project, your overall development and deployment workflows and (maybe most importantly) on your and your teammates‘ personal preferences. However you choose to work, just make sure to agree on a common workflow that everyone follows.

HELP & DOCUMENTATION

Get help on the command line
$ git help

This document is from git-tower

stevenscodes's People

Contributors

master-alcy avatar

Watchers

James Cloos 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.