GithubHelp home page GithubHelp logo

githelpline's Introduction

GIT Commands and branching concepts

GIT COMMANDS

git config --global user.name "guptavinod"
git config --global user.email "[email protected]"
git config --list (in home dir) 
git status
git add <file> [to staging]
git reset <file> [staging to local area]
git commit -m "jmd"<file>
git push -u origin master 
git pull origin master
git log
git log --all --graph --decorate --oneline (logging history)

touch .gitignore (file created and thhis file in working directory and contains files to be ignored)	

git remote -v (information of remote repository)

git branch -a (information about branches in our repository - locally an remotely)


git branch newbranch
git checkout newbranch 
git push -u origin newbranch |  make changes and push back using push command 

--> Now we have 2 branches - master and newbranch and now lets merge them
git checkout master 
git pull origin master (incase there are changes in master - keep in synch with local)
git branch --merged (see what is merged currently - will show only master)
git merge newbranch (merges changes to master where you are sitting right now)
Check again: 
git branch --merged (will show master and new branch)
git push origin master (after merging the changes to the master push it up again to the repository)
	
Now to delete the branch: 
git branch -d newbranch
git branch --merged (check now only master remains again)
git branch -a (check whther gone - local shows only master while remote still has newbranch - hence the next step) 
git push origin --delete newbranch (delets it from remote repository GIthub as well)

https://www.youtube.com/watch?v=HVsySz-h9r4
https://www.javacodegeeks.com/2016/07/git-tutorial.html#section_4_1

GIT FLOW

Git branching model

The overall flow of Gitflow is:

  • A develop branch is created from master
  • A release branch is created from develop
  • Feature branches are created from develop
  • When a feature is complete it is merged into the develop branch
  • When the release branch is done it is merged into develop and master
  • If an issue in master is detected a hotfix branch is created from master
  • Once the hotfix is complete it is merged to both develop and master

For complete understadning on above model visit following link: https://nvie.com/posts/a-successful-git-branching-model/.

Other reference GIT commands for quick reference

> git checkout -b f1 develop
> git checkout -b f2 develop

> git push --set-upstream origin f1

> git checkout develop
> git merge --no-ff f1
> git push origin develop

> git checkout -b release-1.0
> git commit -am "bug fixing done"
> git push --set-upstream origin release-1.0

> git checkout master
> git merge --no-ff release-1.0
> git tag -a 1.0
> git push origin tag 1.0
> git push origin master

> git checkout develop
> git merge --no-ff release-1.0
> git push
> git branch -d release-1.0

SmartGit Tool for using GIT-Hub
URL of video on Version Controlling with SmartGit and Github:
https://www.youtube.com/watch?v=Aj-sZ2JWnj4

Blogs:
Understand GIT Flow using GIT native commands:
https://nvie.com/posts/a-successful-git-branching-model/
https://jeffkreeftmeijer.com/git-flow/

Repo:
https://github.com/nvie/gitflow

Videos:
https://buildamodule.com/video/change-management-and-version-control-deploying-releases-features-and-fixes-with-git-how-to-use-a-scalable-git-branching-model-called-gitflow#viewing
https://vimeo.com/16018419

FOR SSH KEY RELATED ISSUES: https://devmarketer.io/learn/set-ssh-key-github/
https://www.youtube.com/watch?v=H5qNpRGB7Qw&list=PLwAKR305CRO-fenwcN2-IC0rgaB6vaJgD&index=8&t=0s

How GIT Commands map to GITFlow commands:
https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow

FOR GIT REBASE & INTERACTIVE REBASE COMMANDS:
https://www.themoderncoder.com/a-better-git-workflow-with-rebase/

GOOD SPRING BLOG & REPOSITORY
https://www.baeldung.com/

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.