A source code management system is an essential tool for software development, used to store, track, and version control software code. It is crucial for collaborative development environments. There are several such tools/platforms available, and GitHub is one of the most popular platforms/tools for source code management. It is freely available for personal use with limited features.
Create GitHub Personal Account
Step 1. GitHub offers free personal accounts with limited features. Please follow the GitHub site(https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts)
to create a free personal account.
Step 2. Create a new repository on GitHub to store and manage code.
To create a repository, login to your GitHub account -> go to the GitHub Dashboard -> Click on New Repository -> Provide Repository Name -> Select repository access level(Public or Private) and finally clock on 'Create Repository'
Step 3. Install the GitHub repositories and Remote Repositories VS code extension.
Step 4: Update the Github global config file with the GitHub email and username using the following commands:
$git config --global user.email "your_email@example.com"
$git config --global user.name "Your GitHub Username"
Step 5. Push the local projects to the GitHub Repositories. For the first time when you initiate Git, VS code will prompt you to log into your GitHub account and provide source code/Repository access to the user.
Step 6. Now, In the Visual Studio Code, from the left panel, select "Source Control" and push the code to the remote repository. If the remote repository/Branch doesn't exist, it will ask you to create one.
Create branch
Step 1: To create a new branch, navigate to Visual Studio Code and click on the area adjacent to the main branch. You will find the option to create a new branch.Step 3: Push the branch to the remote Git repository.
Git Commands
If you are new to Git, it might be easy to use the GUI to execute Git operations, but over time, using Git commands will be much easier and faster.Here are some common and useful Git commands:
$git push // push the current working branch into the report. If the remote doesn't exist then we will create a new remote branch
$git pull // pull the current working branch's changes into local
$git checkout branch_name // This command switches the working branch in the local
$git merge branch_name // merge the branch_name into current working branch
$git add file // add new file into stage
For more commands, please visit the https://github.com/joshnh/Git-Commands
Reference
https://docs.github.com/en/get-started/learning-about-github/types-of-github-accounts
https://github.com/joshnh/Git-Commands
No comments:
Post a Comment