COMMANDS IN GIT

bagavath ravichandran - Feb 19 - - Dev Community

Here are a few Git commands that are going to be used in the terminal as follows,

1.git add (eg:text.txt)

  The git add command adds a specific (text.txt) file from  
  working directory to the staging area.
Enter fullscreen mode Exit fullscreen mode

2.git status

 The git status command displays the state of the working 
 directory and the staging area.
Enter fullscreen mode Exit fullscreen mode

3.git restore --staged (eg:text.txt)

  For example If you have staged  the (text.txt)files with the 
  git add command that you later decide not to commit, you can 
  unstage these changes using this command.
Enter fullscreen mode Exit fullscreen mode

4.git add.

  This command will not add a specific file but it will  add 
  all modified and untracked files to the staging area.
Enter fullscreen mode Exit fullscreen mode

5.git push

  The git push command is used to upload local repository 
  content to a remote repository. Pushing is how you transfer 
  commits from your local repository to a remote repository.
Enter fullscreen mode Exit fullscreen mode

6.git log

  git log lists the commits made in the local repository.
Enter fullscreen mode Exit fullscreen mode

7.git log --oneline

  This command will display each commit on a single line.this 
  will be very useful for a project overview
Enter fullscreen mode Exit fullscreen mode

8.git pull

  The git pull command is used to fetch and pull the 
  content from a remote repository to the local 
  repository.
Enter fullscreen mode Exit fullscreen mode
. . . . . . . .