Giter Club home page Giter Club logo

00_git-training's Introduction

GIT Tranining

Initialize repository

You can make new local repository: git init or you can clone from remote repository: git clone <url>

Do:

Fork the repository https://github.com/icesi-ops/00_git-training alt text

Clone your forked repository

  • git clone https://github.com/ikermatias/00_git-training

Workflow

alt text
alt text

Branches

The branches are used for make new functions isolated.
'master' is default branch.

Do:

  • git checkout -b <my_name>

Util commands:

Command Description
git branch -d <branch_name> Delete branch
git branch View branches and highlight the current branch
git checkout <branch_name> Switch to branch
git checkout -b <branch_name> Create and switch new branch

Add and Commit

Do:

  • echo "your_name" >> names
  • git add <filename> or git add .
  • git commit -m "Add my name

Send your changes

Now that you have your changes in "HEAD" (local) you can send the change to remote repository.

Do:

  • git push origin master

Or Also you can send the changes to other branch of your remote repository

  • git push origin <branch_name>

Pull request (Github flow)

GitHub flow is a lightweight, branch-based workflow that supports teams and projects where deployments are made regularly.

Open pull request

Pull Requests initiate discussion about your commits. Because they're tightly integrated with the underlying Git repository, anyone can see exactly what changes would be merged if they accept your request.
alt text

Discuss and review your code

Once a Pull Request has been opened, the person or team reviewing your changes may have questions or comments. Perhaps the coding style doesn't match project guidelines, the change is missing unit tests, or maybe everything looks great and props are in order. Pull Requests are designed to encourage and capture this type of conversation. alt text

Update and merge

You can update local repository to newest commit

  • git pull

For merge current branch with other branch

  • git merge <branch_name>

Utils commands

Replace local changes

  • git checkout --

Undo all changes and commit

git fetch origin
git reset --hard origin/master  

REFERENCES

00_git-training's People

Contributors

ikermatias avatar icesi-ops avatar felipej9805 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.