All Github Git Commands to store everything from local github

  • Configure Git (First Time Git Bash Setup)
    git config user.email "my@emailaddress.com"
    git config user.name "UserName"
  • Start git after onclick folder
    git init
  • See git status to check what is the changes
    git status
  • Add All files to git
    git add .
  • Git Commit before pushing anything
    git commit -m "This is my commit message"
  • Git Changes
    git log
  • Add a remote repository in Github
    git remote add origin https://github.com/try-git/try_git.git
  • Push Into Origin>master and save master next time by -u
    git push -u origin master
    Next time only
    git push
  • Create Branch and move to that branch
    git checkout -b BranchName
    Or just create Branch git branch BranchName
    Then switch to that branch git checkout BranchName
    After completing this branch work switch to master git checkout master
  • Push Folder/Files in branch
    git push https://github.com/RepositoryAddress BranchName
  • Pull Folder/Files from repository
    git pull
  • Remove Branch
    git push https://github.com/RepositoryAddress :BranchName
    git branch -d BranchName
  • Get back the last commit for any file
    git checkout -- file_name.txt
  • Remove all text file and stages
    git rm '*.txt'
  • Merge with branch and master
    git checkout master
    git merge BranchName
  • Clone repository into local repository
    git clone https://github.com/RepositoryURL
  • Creating Tag -a means add >> -m means message of that tag
    git tag -a TagName -m "my version 1.4"
    Show that tag
    git show TagName

Advance:

Merge Procedure:
From Master

  1. Everyone or every branch push as their own style in their repo.
  2. Master branch Admin then do the following things -
  • git fetch --all
  • One by one merge:
    git merge origin/branch_name // git merge origin/akash
    git add .
    git commit -m "Merge Akash Branch - Feature XXX"
    git push
  • For another repo
    git merge origin/branch_name git merge origin/farid
    git add .
    git commit -m "Merge Farid Branch - Feature XXX"
    git push

  • From Branch
    git fetch origin master
    git merge origin/master
  • Sync with my branch
    git add .
    git commit -m "Merged with HR Services, HR screens"
    git push

All GitHub git commands list in one place.

Why I've stored this:
At first when I've created a repository in GitHub that makes a lot of time to upload all of the folders and then get this git. You can't believe that I've uploaded a project of 30,000 files in just 30 seconds in GitHub. That was really incredible. From that time , I like git. And here's the all useful git command list at a place. Use this git commands. Having any problem, just comment out.


Or In Github gist


Tags:
Github all git commands, Github git, git commands at a place, All basic git commands, Github git commands
All Github Git Commands to store everything from local github All Github Git Commands to store everything from local github Reviewed by Maniruzzaman Akash on February 01, 2018 Rating: 5

8 comments:

Powered by Blogger.