How to Host Your Project on GitHub and GitLab?
How to Host Your Project on GitHub and GitLab?
Just stepping into the world of professional programming? Or are you just getting ready to showcase your finest projects to the recruiters via an impressive project portfolio!?
In all those events, platforms like GitHub are a game changer to manage your project repositories and enhance collaborative project creation.
Anyways let’s hop onto the main part that is “How to Host your project on GitHub and GitLab?”
Basically, there are two ways to do so, but hang on..! before that you need to create a GitHub or GitLab account which is really simple:
You just open the GitHub / GitLab website on your browser > hit sign up on the Top-right Corner > Enter your Email and click on continue.
Then you’re asked to set a Username (a unique one) > set a Password > click confirm and Congratulations! You’ve successfully created a new GitHub/ GitLab account.
Now Let’s talk about the two methods to host your project:
A. For my ‘Not so nerd’ mates out there, I’ll teach you a simple User friendly approach to upload your project files on GitHub, Steps are as follows:
Creating a New Repository:
Once you’re into your GitHub account, On the Top, Select the repository tab > hit the New button at the top right corner in green color to create one.
Write a suitable Name for your Repository > Select Public or Private to control who can access your repo > check the ‘Add a ReadMe file’
Uploading your codes/ Files:
In your current repository, Just above and rightwards to the main box, there’s an option to Add Files just click on it.
Now select Upload files > Choose your files then one by one choose all of your desired project files from your computer directory.
Once uploaded all, Scroll down to find the green button that says ‘Commit changes’ and click on it.
Now you will have all your files uploaded and reflected in your repository.
Additionally, You’ll need to fill the description of your project in the ReadMe file, you can do so by clicking on the pencil icon present at the right corner of the ‘ReadMe’ box, Just scroll down & commit changes.
Congratulations! Now your repository has been created on GitHub and you’re hosting your first project on it. Good Luck!
Hang on! If you’re trying to land into a good industry then Jobavasar.com is the place where you can explore numerous job opportunities.
B. Now for my geeks out there who want more control, professional workflow or want to work through their local git offline or know the real deal, there’s a method ‘B’ in here to host a project on GitHub or GitLab (works for all kinds of Git):
If you don’t have Git on your system, just install it by simply googling.
(For my mac users: open your terminal and type: brew install git ->if you have homebrew)
2.Create a remote Repository same as in Method A: “Creating a New Repository”.
3. Set Up Your Local Project
Through the command prompt or terminal Open the directory of your project on your computer:
cd /users/xyz/Project_folder
git init #to initialize the local repo
git add. #to upload all the files in the current directory
git commit -m "Initial commit"
4. Link the Local repo to the GitHub / remote repository:
Copy the URL of your GitHub/ Lab repository and paste it inside <REMOTE_URL> of this command:
git remote add origin <REMOTE_URL>
git branch -M main
git push -u origin main
Finally!! Your files are there on your GitHub/ GitLab repository, go checkout and thank me later!