Skip to content

jonmcdonald/VistaModels

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

This repository will contain Vista Architect model libraries and projects.

To create a new area, make a directory then run vista under that directory.  Any data 
you create should stay under the created directory.  You should be able to point at 
libraries in other directories within this repository as well as make modifications 
to elements in those other directories.

To get started with git using this repository execute:

> git clone git@github.com:jonmcdonald/VistaModels.git
> Or git clone https://github.com/jonmcdonald/VistaModels.git

  Documentation on git can be found at: http://www.git-scm.com/documentation 

A few useful git commands follow

- To reset your git area to what is on the server.  This will delete any files you've added.
   > git fetch
   > git reset --hard HEAD
   > git clean -f -d
   > git pull
   Note that git clean will accept a path and only clean that path.

- To PUSH changes to git, a number of steps need to be followed
   - Note this is not needed to fetch/clone the repository 
   - Create a github account via https://github.com/

   - In your cloned git workspace, set your git user name and email
   > git config --global user.name "gitHubUserName"
   > git config --global user.email your_name@email.com


***   PLEASE EMAIL jon_mcdonald@mentor.com that you will wish to commit changes to the repository ****

 - To add local changes to the repository
   First commit your local changes
   > git add --dry-run . 			; This will list what will be added without doing it.
   > git add -u --dry-run . 			; -u will only add modified files, not new files
   > git add .					; Add -u if you only want to cimmit modified files.
   > git commit -a -m "Comment changes"

   # Next fetch latest from repository, merge and push
   > git fetch origin
   > git status                                 ; Tells you what is out of date or changed
   > git merge origin/master
   > git push origin master			; pushes your changes into the master repository for all to use

*** Optional ssh **********************************************************************************
Create load a ssh key on your machine and store in github
	- See https://help.github.com/articles/generating-ssh-keys

- if ssh has been configured and errors are encountered pushing your local commits to the repository you may need to edit the .git/config's url to use ssh://git@github...., if the error is similar to http://stackoverflow.com/questions/7438313/pushing-to-git-returning-error-code-403-fatal-http-request-failed

.git/config
	....
	[remote "origin"]
		fetch = +refs/heads/*:refs/remotes/origin/*
	xxxxxx	url = https://github.com/jonmcdonald/VistaModels.git ;# Did not work, use below xxxxxxxx
		url = ssh://git@github.com/jonmcdonald/VistaModels.git 
	....
***************************************************************************************************
 - To add all of your new files and then update from the repository, taking the repository as the correct file.
   You will loose any changes you have made that conflict with what is in the repository.
   First commit your local changes
   > git add *
   > git commit -a -m "Comment for committed file set"
   Next fetch from the repository and overwrite any local conflicts
   > git fetch origin master
   > git merge -s recursive -X theirs origin/master

 - To cause a tracked file which changes local not to be checked in (ignore it)
   > git update-index --assume-unchanged path/to/file.txt
   To cause it to be checked in again
   > git update-index --no-assume-unchanged path/to/file.txt

 - Tentative flow
   Create local branch.  This branch will not be pushed to the server
   > git branch <branch-name>
   Do your work on the branch, commit changes and add files
   > git add <files>
   > git commit -m "Comment message" <files>
   To eliminate files that have been changed locally but not committed.  Such as .mb files that you don't want
   to check in, you can checkout a given directory to overwrite changes. This may be useful before rebasing.
   > git checkout .
   Keep up with any changes on the server by rebasing.  First pull updates from master
   > git checkout master
   > git pull origin master
   Then rebase.  This is done while you are on the <branch-name> you created.  Do this to keep up with master.
   > git checkout <branch-name>
   > git rebase master
   When ready to push changes to repository, first update local master to what is on repository
   > git checkout master
   > git pull origin master
   > git checkout <branch-name>
   > git rebase master
   Everything is up to date, now do a fast forward merge to move master up to all of the changes on <branch-name>
   > git checkout master
   > git merge <branch-name>
   Assuming no problems, now push the changes
   > git push origin master

For files that will be checked into the repo, but will change locally when we do not
want the local changes checked in, such as the vista.ini file do the following:
   > git update-index --assume-unchanged <file-name>
The file can be checked in later if needed.

To change URL of remote:
   > git remote set-url origin ssh://jmcdonal@localhost:2022/git-repository/lv2/platforms/<repo>