Git Product home page Git Product logo

howto's Introduction

tests

HOWTO:

=============== ONLINE GITHUB:

  1. CREATE/CLONE a given repository.
  2. Start a new BRANCH: Copying master (default branch) to edit
  3. COMMIT: Making mods and saving files changes into branch (with associated message)
  4. Open a PULL request: Propose your changes with a message, request someone reviews and pulls in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches.
  5. MERGE a pull request: Bring in your branch edits into the master branch.

============ LOCAL REPO:

  1. CLONE repo:

git clone /path/to/repository git clone username@host:/path/to/repository git config color.ui true (nice looking)

e.g. git clone https://github.com/jniedzie/LightByLight2018.git

If you have not cloned an existing repository and want to connect your repository to a remote server, you need to add it:

git remote add origin

Local repo = 3 "trees": Working Directory (actual files), Index (staging area), HEAD (points to the last commit you've made).

  1. Add changes to your Index:

git add git add -i *

  1. COMMIT: (to your local working HEAD, but not yet in your remote repository):

git commit -m "Commit message"

  1. PUSH: (changes to your remote repository):

git push origin master/branch

  1. BRANCHES:
  • Create a new branch named "feature_x" and switch to it:

git checkout -b feature_x

  • Switch back to master:

git checkout master

  • Delete the branch again:

git branch -d feature_x

  • Push the branch to remote repository:

git push origin

  • Update your local repository to the newest commit (fetch and merge remote changes):

git pull

git merge

  • Edit conflicts manually, and preview changes:

git diff <source_branch> <target_branch>

  • After changing, you need to mark them as merged:

git add

  1. TAGGING:

tagging

  • Create tag for software release: git tag 1.0.0 1b2e1d63ff

(1b2e1d63ff = first 10 characters of the commit id you want to reference with your tag.

  1. LOG: Inspect changes in repo:

git log git log --author=bob git log --pretty=oneline git log --graph --oneline --decorate --all git log --name-status (see only which files have changed)

  1. Replace local changes:
  • Replace the changes in your working tree with the last content in HEAD (changes already added to the index, as well as new files, will be kept):

git checkout --

  • Drop all your local changes and commits, fetch the latest history from server and point your local master branch:

git fetch origin git reset --hard origin/master

howto's People

Contributors

denterria avatar

Watchers

 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.