Git Commands

To close Git Bash in windows : We are inside vim. To save changes and quit, type:

<esc> :wq <enter>

That means:

  • Press Escape. This should make sure you are in command mode
  • type in :wq
  • Press Enter

An alternative that stdcall in the comments mentions is:

  • Press Escape
  • Press shift+Z shift+Z (capital Z twice).


Pull Request

1. **Fork the Repository:**

   If you haven't already, fork the repository you want to contribute to. This creates a copy of the original repository under your GitHub account.


2. **Clone the Repository:**

   Clone the forked repository to your local machine using the `git clone` command in your terminal:

   ```

   git clone <repository-url>

   ```


3. **Create a Branch:**

   Create a new branch on your local machine where you'll make your changes:

   ```

   git checkout -b <branch-name>

   ```


4. **Make Changes:**

   Make the necessary changes to the code or files in your local branch.


5. **Commit Changes:**

   Add and commit your changes to the local repository:

   ```

   git add .

   git commit -m "Your commit message here"

   ```


6. **Push Changes:**

   Push your local branch to your forked repository on GitHub:

   ```

   git push origin <branch-name>

   ```


7. **Create Pull Request:**

   Go to your forked repository on GitHub and switch to the branch you just pushed. Then, click on the "Pull Request" button.


8. **Compare Changes:**

   Compare the changes between your branch and the original repository's branch. Ensure that the changes are as expected.


9. **Submit Pull Request:**

   Once you're satisfied with the changes, submit the pull request by filling out the necessary information (such as title, description, etc.).


10. **Wait for Review:**

   After creating the pull request, wait for the repository maintainers to review your changes. They may request modifications or approve and merge your pull request.


Remember, when creating a pull request, it's essential to provide clear and concise information about the changes you've made and why they're necessary.


---------------------------------------------------------------------------

git init

Description: Initializes a new Git repository in the current directory.

Usage: git init

---------------------------------------------------------------------------

git clone


Description: Clones an existing Git repository from a remote server to your local machine.

Usage: git clone <repository-url>

---------------------------------------------------------------------------

git add


Description: Adds changes in the working directory to the staging area.

Usage: git add <file> (to add a specific file) or git add . (to add all changes)

---------------------------------------------------------------------------

git commit


Description: Records the changes made to the files in the repository.

Usage: git commit -m "Your commit message here"

---------------------------------------------------------------------------

git push


Description: Pushes the committed changes in the local repository to a remote repository.

Usage: git push <remote-name> <branch-name>

---------------------------------------------------------------------------

git pull


Description: Fetches changes from a remote repository and merges them into the current branch.

Usage: git pull <remote-name> <branch-name>

---------------------------------------------------------------------------

git status


Description: Displays the current state of the working directory and the staging area.

Usage: git status

---------------------------------------------------------------------------

git branch


Description: Lists, creates, renames, or deletes branches.

Usage: git branch (to list branches), git branch <branch-name> (to create a branch), git branch -d <branch-name> (to delete a branch)

---------------------------------------------------------------------------

git checkout


Description: Switches branches or restores working tree files.

Usage: git checkout <branch-name> (to switch branches), git checkout -b <new-branch-name> (to create and switch to a new branch)

---------------------------------------------------------------------------

git merge


Description: Merges changes from one branch into another branch.

Usage: git merge <branch-name>

---------------------------------------------------------------------------

git log


Description: Displays a list of commits in reverse chronological order.

Usage: git log

---------------------------------------------------------------------------

git remote


Description: Manages remote repositories.

Usage: git remote add <remote-name> <remote-url> (to add a remote repository), git remote -v (to list remote repositories)

---------------------------------------------------------------------------

git fetch


Description: Downloads objects and refs from another repository.

Usage: git fetch <remote-name>

---------------------------------------------------------------------------

git reset


Description: Resets the current HEAD to a specified state.

Usage: git reset <commit> (to move the HEAD to a previous commit)

---------------------------------------------------------------------------

git rebase


Description: Reapplies commits on top of another base tip.

Usage: git rebase <base-branch> (to rebase the current branch onto <base-branch>)

---------------------------------------------------------------------------



IANA timezone details in short

  The IANA Time Zone Database (often called tzdata , zoneinfo , or the Olson database ) is the global standard for representing time zones ...