Code Monkey home page Code Monkey logo

intermediate-git-commands's Introduction

Intermediate-Git-Commands

create branch command

  • Create a new branch called ->jasp-feature git checkout -b jasp-feature

Delete branch

  • Delete a branch -> jasp-feature git branch -D jasp-feature

Delaing with conflicts

  • create new branch git branch -b jasp-conflict-1
  • Modify branch "jasp-conflict-1"
  • commit & push changes
  • push changes to github git push origin jasp-conflict-1
  • go to github -> create pull request from main branch

Let's say there is another developer - who will create another branch

  • git branch -b jasp-conflict-2
  • Modify feature1.txt, add file, commit and push changes git add . git commit -m "modified feature1.txt in jasp-conflict-2 branch" git push origin jasp-conflict-2

Till now, we have 2 branches - jasp-conflict-1 & jasp-conflict-2 and we created pull request for both branches

  • Now, we merge one of the pul request - let's say - jasp-conflict-1
  • Now, we will see merge conflicts because 2 brances trying to edit the same line & git doesn't know what version of file to take
  • To resolve conflict -> either do from github or go to VS studio code keep the code which you want to keep and merge with main

intermediate-git-commands's People

Contributors

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