Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagebash
git checkout -b <branch-name>

2. Make any changes to the files , then when you are ready to commit. as necessary.  Then when you're ready to commit, check the files that have been changed to make sure you're only including things that you've intentionally changed. This command can only be run when you're in your local repository. 

Code Block
git status

If all the files are what you expected, you can use the follow command to add all the files listed to your commit.  

Code Block
git add . 

Otherwise, you may add each file seperately with git add. Often times you may have looked at another schematic or PCB in your local repository while working on your project and inadvertantly made changes. This can be easily fixed by running git add . in your project folder. It may look something like this: 

Code Block
cd altium-lib
git add . 
cd ..
cd MSXII_PowerDistribution
git add . 
cd ..


3. If you are satisfied with the list of files added, you may now commit to your branch. Please make sure to tag your JIRA ticket (ELEC-###) in each commit. Also make sure that you have a meaningful message describing what you changed. You may also add a TODO to help you keep track of things if wished. The following command should only be used for simple (1-2 lines) commit messages

Code Block
languagebash
git commit -m'ELEC-### Commit message' 

Alternately, if you type 

Code Block
git commit

a Vim window should open in your console. It should look something like this: 

Code Block
# Please enter the commit message for your changes. Lines starting
# with '#' will be ignored, and an empty message aborts the commit.
# On branch elec_191_chaos_layout
# Your branch is up-to-date with 'origin/elec_191_chaos_layout'.
#
# Changes to be committed:
(List of files that were added, deleted, or modified) 

By pressing i for "insert", you can now add text in vim. The benefit of writing your commit message in vim is that it allows you to format multiple lines of comments easily. If you made any library changes, you should include them here as well. The more detailed your commit message is, the easier it is for others to understand what you've been working on. A sample commit message may be as follows. Note that any line with a # is not included in your commit message, and git will not allow you to commit without any a message. 

Code Block
ELEC-191 Power Distribution Board Rev 2.1
- Modified schematic to include missed connection between Aux_IN and the LTC4417

Schematic Library: 
- Added CAP ALUM 100UF 20% 16V RADIAL
- Linked CONN 6POS ULTRAFIT 0.138" to its footprint in the footprint library

Footprint Library
- Added CAP ALUM 100UF 20% 16V RADIAL
- Added CONN 6POS ULTRAFIT 0.138" 

TODO: 
- Modify layout to include the bulk capacitor
# Please enter the commit message for your changes. Lines starting
# with '#' will 

...

be ignored, and an empty message aborts the commit.
# On branch elec_191_chaos_layout
# Your branch is up-to-date with 'origin/elec_191_chaos_layout'.
#
# Changes to be committed:
(List of files that were added, deleted, or modified) 

After you've written your commit message, press ESC followed by :wq to exit vim and save the commit message. More commands in Vim may be found here

4. Then you can push all your local changes to the repository. For If you're pushing to the branch for the first time. If you forgot to do this, git should remind you to do somay prompt you to set the upstream branch. In that case, type exactly what is prompted

Code Block
languagebash
git push --set-upstream origin branch-name

...