kescobo / KCLabgit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

A repo for a git workshop with the Klepac-Ceraj Lab

Many of the git commands used in the tutorial can be found below. As you follow along the tutorial, feel free to copy-paste to make things easier. Stuff enclosed in <BRACKETS>, and in all caps should be replaced with user-specific info.

This tutorial focuses on using the command line for git, but Graphical user interfaces (GUI) versions of git can be found here.

  1. Git local set-up (global config)
  2. Cloning the repo
  3. Stage changes
  4. Commit changes
  5. Push changes
  6. Make a new branch

Global Configurations

See here for more info

$ git config --global user.name "<YOUR NAME>"
$ git config --global user.email <YOUR EMAIL>

Cloning the Repo

The repo is hosted on github

$ git clone https://github.com/kescobo/KCLabgit.git
$ cd KCLabgit

Stage changes with git add

$ git add <FILE_NAME>

Commit changes

$ git commit -m "<COMMIT MESSAGE>"

Alternatively, you can just do:

$ git commit

And your default shell text editor will open, allowing you to enter a commit message. If your files are already version controlled, you can skip the "stage" step, commiting all previously tracked files in one command using the -a flag:

$ git commit -am "<COMMIT MESSAGE>"

Push Changes

If you cloned the repo, your "upstream" is already set. If you want to push to the same repo:

$ git push

If you want to push somewhere else, you can set a new upstream repo:

$ git remote add <REPO_NAME> <REPO_URL>
$ git push -u <REPO_NAME> <BRANCH_NAME>

Make a New Branch

$ git checkout -b <BRANCH_NAME>
# Make changes
$ git commit -am "<COMMIT MESSAGE>"
$ git push -u origin <BRANCH_NAME>

About


Languages

Language:Python 100.0%