-
Notifications
You must be signed in to change notification settings - Fork 0
Source Control Git Tutorial
From the git webpage, Git is "a free and open source distributed version control system". This means that it helps you control different versions of your project, and easily jump to an older version if something goes wrong. It is better than having a files called 'project.c' , 'project_newer.c' , project_newer_2.c" to try to keep different versions of your project. While there are graphic user interfaces for using git, we will use the command line.
Go to this site. Choose your OS, and you'll download the git installer. Run the installer and follow the instructions. Keep all the options default. After git is installed, search for and use Git Bash to open the command line. There are also GUIs for git, but its good to know the command line.
You can use various commands to pull/push and commit changes to a git repository.
-
Two ways to get a repository:
git clone [url]
This commands clones a repository onto your local computer. (Make your way to the directory you want the git repo to be in using thecd [path]
command in command line.) To clone the quickforms repository you would entergit clone https://github.com/uoForms/quickforms3.git
git init [directory]
. Allows you to create a completely new repo, rather than clone an existing one. Replace the[directory]
with the path to your project to create a git repo for your project. If your project already has files, than you will need to add them (see below) to start tracking changes. -
git add [fileName]
This command stages the given file, which means that the next time you commit, changes to this file will be recorded in the local repository. If you modify a file after adding it, make sure to add the file again or only the original changes will be updated. Exgit add READ_ME.txt
-
git status
This command will tell you the current 'status' of your project. It lists all the files you have staged to be committed, as well as any files you modified but haven't committed. Use this often. -
git commit -m "message"
This command records the changes to your local repository. After youadd
the modified file(s), you should commit the changes. The "message" is a description of the changes your made. -
git remote show origin
This command displays information about the remote repo called origin (origin is the shortname for the repo set up when you cloned from github) -
git pull
After you've cloned a remote repo (the one on github), this commands goes to that remote repo and pulls down any changes you don't yet have. It then merges them to your local repo. (You can also usegit fetch
which gets all the changes but doesn't merge them so you can look through them and decide which to merge). -
git push origin master
This command pushes all the modifications you've made to the remote repo (the one on github). Note thatorigin
is the name of the remote repo that was set up when you cloned, andmaster
is the master branch of that repo. You can push to another repo by using its name instead. If you try to push while there are changes on the remote repo that you don't have on your local repo, this command will fail.
-
Quickforms Basics
-
Tutorials
- Setup Tutorials
- App Development Tutorials
-
Assignments
-
Project
-
Applications
-
Quickforms Advanced
- Project With Database
- Advanced Setup
- HealthApp with Database
- Source Control
- Joining the Team
- Cordova Native Application
- Miscellaneous
- Project With Database
-
-
Form Controls
-
App Controls
-
Report Controls
-
Server Controls
-
Quickforms DAO
-
Email Notification
-
Migrating QuickForms3(Test Server) to QuickForms(Production-Server)