Header Ads

Header ADS

Learning git for our project version control and files management

 Git image


There are two things in this learning one is git, and the other one is Github.

Git is a version control system that lets you manage and keep track of your source code history. GitHub is a cloud-based hosting service that lets you manage Git repositories. If you have open-source projects that use Git, GitHub is designed to help you better manage them.

Generally, as project members, we use GitHub to save our project files in the cloud and control the version. Now the question is how we can do it?

GitHub:

Just go to the GitHub website and sign up if you're not a member. Or sign in if you already have an account.

Now, you need to create a repository. You can create it from GitHub or by the command line. If you're a beginner, then for simplicity, create a repository from GitHub profile.

That's all you need to do with GitHub. Now you need to play with Git.

Git:

Git is a free and open-source distributed version control system designed to handle everything from small to huge projects with speed and efficiency.
  1. Install Git from their website. During installation on the Select Components tab, marks Git Bash Here and Git GUI Here for the simplicity of your system.
  2. Create or open a folder where contains the project files you want to upload on GitHub.
  3. Finally, from that folder right click on the mouse and select Git Bash Here.

Pushing files to GitHub:

You need to initialize Git to this folder. So run this command:
git init

Then you need to tell Git that what you want to add. So run this command:
git add .

Then you need to tell Git that what you have done in this code by committing them. So run this command:
git commit -m "YOUR UPDATE TEXT"

Then you need to set the path where you want to upload the files by adding a branch. By default, it will count as the master branch. So run this command:
git remote add origin YOUR_REPOSITORY_LINK

Finally, you need to push the files to upload the files. So run the command:
git push origin master

N.B: You may need to set your name and email for Git configuration.
To set the name, use this command:
git config --global user.name "FIRST_NAME LAST_NAME"

To set the email, use this command:
git config --global user.email "MY_NAME@EXAMPLE.COM"

We hope you can do it. It was a basic instruction for Git. Leave a comment if you faced any problems.

No comments

Powered by Blogger.