Giter Site home page Giter Site logo

git-command-help's Introduction

Git Demo

This is a demo git repo with a list of commands as a cheat sheet.

Creating a local repo

  1. Change into the required folder: PC: cd %HOME%\Source\Repos\ MAC: cd ~/Source/Repos

  2. Create New Folder: mkdir Project-Name

  3. Change into the new folder cd Project-Name

  4. Initialise with git git init

  5. Change master to main git branch -m master main

  6. Check the status git status

  7. Create a .gitignore MAC: touch .gitignore PC: echo "" > .gitignore

  8. Add required "ignores" to the .gitignore file. Recommend that you use a known .gitignore or head to http://gitignore.io

  9. Check the status git status

  10. Add and commit the ignore file to version control git add .gitignore git commit -m "Original Commit

  11. Verify commit git status

Adding files to Tracking

git add filename git add -A git add foldername/* git add.

Checking the logs

git log

Create a branch

git branch Branch_name

Changing branch

git checkout Branch_name

Merging changes from one branch into main

git checkout main git status git merge Branch_name git status git log

Remote Repositories

Before you ca use remote repository(repo) you need to have created it on the remote system

We will use GitHub for this purpose, other remote repositories that use Git are also valid

Create a remote repo

  1. Head to http://github.com
  2. If you do not have an account, create a github account
  3. Create a new repo making sure that:
    • Do not add a README.md
    • Do not add a License
    • Do not add a .gitignore
    • In other words: Do not add anything to the blank repo

Connecting a remote repo

git remote add origin https://github.com/bijit85/git-command-help.git

origin = alias for the remote

Pushing commits to remote

git push -u origin main

Cloning a repo

git clone https://github.com/bijit85/git-command-help.git

Cloning allows you to work on code on a new machine

Helpful tips regarding git use

Go to https://www.git-tower.com/windows

Asides

Heading1 Heading2 Heading3

git-command-help's People

Contributors

bijit85 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.