Skip to content

akash-vartak/try

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

About

This document is for those people who are relatively new to GitHub but know the basic concepts like repositories and commits etc. For experts this document can act as a revision document.
Happy learning!!

Commands

  1. Creating a repository: git init
    You need to be in the repository that is to be initialised as the git repository

  2. Checking status: git status
    Command gives the current status of the the repository irrestective of file being commited or not. Status includes whether file is 'tracked' or 'untracked' or 'modified' etc.

  3. Adding file:
    git add <file_to_add> Adds the specified file to staging area
    git add . Adds all untracked files to staging area
    git add *.<extension> Adds all files with the specified extension
    Adding is only done to the staging area and not to the final commit straight away!!

  4. Making a commit: git commit
    Command redirects to an editor where you have to specify some description regarding the commit. This commits the files that were present in the staging area only!!

  5. Unstaging a file: git rm --commit<file_name>
    Removes the file from the staging area and transfers it back to the modification area.

  6. Changed files:
    git diff Command shows the changes made to the files. Command works only when the file is in the unstaged area.
    For staged files: git diff --staged

  7. Pushing to remote repo:
    git remote add origin <url to the remote repo>
    git push -u origin <branch to which pushin is to be done>

  8. Pulling from your own remote repo to a locally existing repo
    git pull <url of remote repo> <branch>
    To pull into a local repo the command prompt control needs to be inside the repo

About

My try at GitHub and Git

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published