Git For Beginners

From Cheaha
Jump to navigation Jump to search


Attention: Research Computing Documentation has Moved
https://docs.rc.uab.edu/


Please use the new documentation url https://docs.rc.uab.edu/ for all Research Computing documentation needs.


As a result of this move, we have deprecated use of this wiki for documentation. We are providing read-only access to the content to facilitate migration of bookmarks and to serve as an historical record. All content updates should be made at the new documentation site. The original wiki will not receive further updates.

Thank you,

The Research Computing Team

Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.


Configuration

To configure user information for all local repositories use the following commands:

  • Set the name you want attached to your commit transactions.
 git config --global user.name "[name]"
  • Set the email you want atached to your commit transactions
git config --global user.email "[email address]"

Initializing a git repository

To initialize a new git repository, run:

[ravi89@login001 Tutorial_June_2018]$ git init test
Initialized empty Git repository in /data/user/ravi89/HPC_Training/Tutorial_June_2018/test/.git/
[ravi89@login001 Tutorial_June_2018]$

To make an already existing directory, a git repo, run:

cd EXISTING_DIRECTORY
git init