Someone please let me know the basics of git process

I’m currently working with some projects and I’d like to hands on with gitlab please give me a solution

  1. what is push ?
  2. what is pull ?
  3. what is PR ?
  4. what is commit ?
  5. what is stash / unstash ?
  6. how to create a branch ?

Hi,

I’d suggest to get a hand on the Git Basics book online where these things are explained in detail. In terms of a PR (Pull Request), you can find more details in the GitHub area. GitLab calls this MR, Merge Request.

You could also checkout our open source training to learn more about Git and GitLab.

Cheers,
Michael

1 Like

What is push?
“push” is a git operation which copy changes from a local repository instance to a remote instance.

What is pull?
Fetch and merge changes on the remote server to your working directory.

What is PR(Process Request)?
It’s a way to submit the contribution to any project which is under development. Often called “merge request” in GitLab.

What is commit?
The “commit” command is used to save your changes(in source code) to the local repository.

What is Stash and Unstash?
In Git, the stash operation takes your modified tracked files, stages changes, and saves them on a stack of unfinished changes that you can reapply at any time.
Let’s go through one life example:
Suppose developer is implementing a new feature. So the code is in progress but for some reason the work has to be stopped. Because of this, Developer have keep aside the new feature work and cannot commit the partial code or throw away the changes. So it need some temporary space, where partial changes can stored and later on commit it. This is all about stashing.

To unstash your changes, execute below command:
git stash pop

If you want to preserve the state of files, use below one:
git stash apply --index

How to create a Branch?
To create a branch: git checkout -b <branchname>, make the changes and commit.
‘push’ this branch to your fork(‘fork’ is a copy of an original repository that you put in another namespace where you can experiment and apply changes that you can later decide whether or not to share, without affecting the original project.[Source: GitLab]): git push -u origin HEAD.
Please go through below URL(Source: tutorialspoint) to create branch through GitLab GUI:
https://www.tutorialspoint.com/gitlab/gitlab_create_branch.htm

1 Like

thanks for your worth share

Thanks for your worth share this is really helpful