Tuesday, May 14, 2024

Basic Git workflow

 Initial situation

You have code in a folder and now you want to uploaded it to a Git repository.

I. Git configuration

$ git config --global user.name UserName
$ git config --global user.email email@example.com

II. Create the local Git repository

$ cd ~/Project01
$ git init
$ touch .gitignore

Write in .gitignore the filenames not to control. For example:

# Compiled source #
######################
*.map
*.o
*.out

will ignore any file with extension .map, .o and .out from the commit.

$ git add .
git status
$ git commit -m "Initial commit"

No comments: