This is a super simple guide to using GIT, creating a Git repo, adding files to the repo, and a few other very basic commands.
- Log in to GitHub. If you don't already have an account, then sign up.
- Choose a username that is easy to remember and share.
- In the REPOSITORIES tab, Select the green NEW button.
- Choose a name for your repository.
- Add a description. Keep it short and useful.
- Select the PUBLIC radio button
- In the "Initialize this repository with:" section select the "Add a README file" option.
- Choose a suitable license for your project. Usually, GNU GPL V3 works.
- Select the green CREATE REPOSITORY button
- Locate the green CODE button (pull down), choose the HTTPS tab and copy the link to your git repo.
- Instructions from here on depend on your OS and the type of GIT client you use (GUI,command line etc)
- I use Linux (Ubuntu) and command line.
- You can find similar instructions for your OS.
- On your local machine, open a terminal.
- Navigate to the folder where you want to have local copy of your GIT repo.
- Do the following command
- git clone https://github.com/yourusername/yourgitrepo.git
- (git clone ctrl+v)
- You now have a local copy of your repo
- Add project files (copy paste) to the local git folder
- In a terminal, in your local git folder,
- git add --all // adds all the files
- git commit -a -m "add commit comment" // creates snapshot of your local repo
- git push // uploads local changes to remote repo
- At this point, your local repo and remote repo are synchronised
- If you have set up a team, and have other members who wish to contribute then they can follow the same instructions as above.
- If someone else makes changes, you can update your local repo by doing
- git pull