Set Up A Git Project - iff133/first GitHub Wiki
1. Create a New Project in Gitlab:
2. Set Up the Project name, the visibility and select the READ.me option:
3. Then you will be directed to this page:
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
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
5. Then just add folders/files as normal:
6. Once you are ready to commit:
a. Check git status -> command: git status
Untracked should show up like so:
b. Use
git add .specific_file_name
or git add . to add all files -> command: git add .
c. Check git status -> command:
git status
The files that appeared in red in a should now be green
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"
Output:
e. To push to the branch of interest -> command:
git push
Accept merges on gitlab and then do a git push -> command:
git pull
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