A quick guide to set up your git and pushing very first project on github
Being a noob in software developer, its very common to feel overwhelmed with lot of jargons and tech stacks. One of them is git. Let's demystify it in very simple steps.
Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development.
Step 1 : Install it from here
Step 2 : Open your files in VS code editor. Go to the files folder in command line terminal.
Step 3 : git --version
should show you latest version of git installed.
git status
The git status command displays the state of the working directory and the staging area. It lets you see which changes have been staged, which haven't, and which files aren't being tracked by Git
Step 4 : initialize a git repository
since there was no git repo in that folder, create one using git init
.
Step 5 : Adds the changes in the working directory to the staging area using git add .
or git add -A
Step 6 : commit your changes using git commit
The git commit command captures a snapshot of the project's currently staged changes. Don't forget to provide a tag for each change you made. for example git commit -m" first commit"
Step 7 : Create an account on github and create a repo
Step 8 : to connect your local git and remote repo, run the following commands
git config --global user.name <github username>
`git config --global user.email
Step 9 : Add remote branch (origin) to your local repo
git remote add origin
Step 10 : push your code on the github
git push -u origin main
_main is the name of local branch. If its 'master' in your system, use master in above code.
and voila, your code has been pushed onto the github in easy simple 10 steps. Now any changes you made in your local repo, just repeat step 5,6 & 10 and those changes will be reflected on github too. Cheers. Happy Learning