-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathGit.txt
More file actions
60 lines (52 loc) · 2.17 KB
/
Copy pathGit.txt
File metadata and controls
60 lines (52 loc) · 2.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# Git: Version control tool
# Github: A cloud for uploading project tracked using Git
- Alternatives:
- Gitlab
- Bitbucket
# Terms:
- repository: Project folder (Being tracked by Git)
- local repository: Local project folder
- remote repository: Project folder on Github
- stage: Prepare files to be committed
- commit: Save changes
- push: Upload
- pull: Download
# Local Workflow
- Working directory: Make changes (Red in terminal)
- Staging area: Changes ready to be 'commited' are moved here (Green in terminal)
- Local repository (.git): Commited changes are saved here
# Steps to upload a project on Github
- Github:
- Create a new remote repository
- name: Name of the project
- description: Description of the project
- visibility: Private/Public
- Public (Open source)
- README.md: Project description file
- Local:
- First time:
- git init: Initialize a local git repository
- git add: Stage files
- git add file1.html: Stage file1.html
- git add .: Stage all files
- git commit -m "Message": Commit changes
- git remote add origin [remote repsitory link]: Link local repository to remote repository
- git push -u origin master: Push commited changes to 'master' branch in the remote repository
- Second time and onwards
- git add: Stage files
- git add file1.html: Stage file1.html
- git add .: Stage all files
- git commit -m "Message": Commit changes
- git push: Push commited changes to 'master' branch in the remote repository
- Generic
- git status: Current status of local repository
# Steps to download a project on Github
- First time:
- git clone [remote repsitory link]: Clone of online repository in local machine
- Second time and onwards
- git pull: Pull latest commits from 'master' branch in the remote repository to local repository
# Branches:
- Default (master/main)
- Separate branches can be created to work on individual featurs. For eg., in Amazon: Separate branches for Amazon Pay, Shopping, Prime Video features
# References:
- https://uidaholib.github.io/get-git/images/workflow.png