Hello, as a developer you need some sort of version control for your changes to your project or repository,handle them and work with colleagues as you do.
So meet Git, its a very straight forward tool I cannot give a well straight forward instruction but as a beginner like you and me I found these video that can help us out. In summary these are the commands you will use from your day to day job using Git.
- git config –global user.name “John Doe” and user.email “email@email” – this is for setting up an account
- git init – starting your repository
- git clone [url_to_the_repository] To download the repository to your current machine.
- git reset –hard origin/master – This is to overwrite your local repository with your remote regardless, git status is up to date as this will destroy your local commits. Use it only if neccessary
- git status – tell us that our working project are the same in the repository if not then use next command
- git add .(all) or git add (filename) – you add the changes to the staging stage ready to be committed or made put the repository
- git commit -m “Your message about the changes” – finally put your changes to the repository
- git fetch – This will collect all the commits from your repository ready to be pulled.
- git pull origin [master] – This will update your local repository from the master branch usually from the remote.
- git add remote origin “https://repo.git” – This will add the link to your remote repository for consumption
- git remove -v – This will display your current remote repository.
- git checkout [branch-name] – This will set up your current branch , as Master is your main branch.
- git log – these views any commits your team has made then add in –author “Beth” to see Beth’s commit message
- git help – get help will show list of commands you can use and their usage
- git diff – show the comparison , and show updates made from the old one, and remember this is before you do a commit. Otherwise there is nothing to show.
- git diff –staged – compare your “staging” changes to your “repository” otherwise default is between “working” directory and the “repository”
Here is now the video you are waiting for, a very informative tutorial that can get you started from beginner to advanced.
Credit to the video uploader. I learned alot from this tutorial. And I am sure you will too.
In another note, once you got a good grasp on Git. You might want to put your repository/project online then you know whats coming , GitHub! There’s other repo container out there but GitHub is like the standard. Anyways thats it for now 🙂