Set Up A Git Project - iff133/first GitHub Wiki

1. Create a New Project in Gitlab:

image

2. Set Up the Project name, the visibility and select the READ.me option:

image

3. Then you will be directed to this page:

image

4. Go to the folder where you would like the git to be in:

Make sure you open the folder in WSL(Windows Subsystem for Linux ):Ubuntu

image

Use the command: git clone [email protected]:iff11/new3.git to clone that repo into that folder -> This will create a folder with the repo's name

Got into that folder -> command: cd name_repo (e.g. cd new3 or cd etl_pipeline)

The master branch should now appear next to the projects path

image

5. Then just add folders/files as normal:

image

6. Once you are ready to commit:

a. Check git status -> command: git status

Untracked should show up like so:

image

b. Use git add .specific_file_name

or git add . to add all files -> command: git add .

image

c. Check git status -> command: git status

The files that appeared in red in a should now be green

image

The files are now ready to be commited**

d. To commit do a git commit and a message must be added -> command: git commit -m"MESSAGE GOES HERE"

image

Output:

image

e. To push to the branch of interest -> command: git push

image

Accept merges on gitlab and then do a git push -> command: git pull

image

Useful Git Scripts

Create a new branch-> command: git checkout -b branch_name

Delete an old branch locally-> command: git branch -d branch_name

List all the branches-> command: git branch -a

Open the git manual-> command: man git

Open the help manual-> command: git helo

Useful Links

https://git-scm.com/book/en/v2/Getting-Started-Getting-Help

⚠️ **GitHub.com Fallback** ⚠️