DEV Community

Pheak Pheasa
Pheak Pheasa

Posted on • Edited on

To init git on my directory to pull project from git repository.

  1. Install Git: Download and install Git from Git Downloads.

  2. Navigate to Your Project Directory: Open a terminal or command prompt and run:

    cd /path/to/your/directory
    
  3. Initialize Git: Run:

    git init
    
  4. Configure Git: Replace "Your Name" and "your.email@example.com" with your details:

    git config --global user.name "Your Name"
    git config --global user.email "your.email@example.com"
    
  5. Add GitLab Repository as Remote: Replace <repository_url> with the actual URL:

    git remote add origin <repository_url>
    

    If you need to edit:

    git remote set-url origin <repository_url>
  6. Pull from GitLab: Replace "master" with the branch name if needed:

    git pull origin master
    

    For private repositories, Git may prompt for your GitLab username and password.

  7. Optional: Check Remote Configuration: Run:

    git remote -v
    

    Verify that it shows the URL of your GitLab repository.

Heroku

Simplify your DevOps and maximize your time.

Since 2007, Heroku has been the go-to platform for developers as it monitors uptime, performance, and infrastructure concerns, allowing you to focus on writing code.

Learn More

Top comments (0)

Billboard image

Create up to 10 Postgres Databases on Neon's free plan.

If you're starting a new project, Neon has got your databases covered. No credit cards. No trials. No getting in your way.

Try Neon for Free →

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay