-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgitFlow_noobs.txt
More file actions
66 lines (52 loc) · 3.26 KB
/
gitFlow_noobs.txt
File metadata and controls
66 lines (52 loc) · 3.26 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
61
62
63
# Run For the first time
git config --global user.name "Marina M"
git config --global user.email "marina.w@gmail.com"
# Upload a new project
git init // Basically 3 steps, 1. add, 2. Commit, 3. Push;
git add . // added to staged area, and ready for commmit; git add -A // same, all files; git add index.html // only specified file - index.html file
git commit -m "first commit" // Save as a snapshot what remain in staged area
git remote add origin https: //github.com/MarinaWeb22/computer-graphics.git ("origin Userdefine", origin=url.git)
git push -u origin main // push, origin user define name like variable contain url. (main default brunch name)
# Work on an existing Project
First, download a project otherwise it will not work
git clone //github.com/MarinaWeb22/computer-graphics.git // Make a clone of remote repo; dir has the same name as repo;
// if type dir name at the end, then repo will be cloned in this dir
git add . //For all new file and folder (git add file_names.exten it is for single file)
git commit -m "committed message" //For a single file(git commit -m "committed message" file_names.exten)
git push -u origin main // First time pushing the branch or if you've made changes that conflict with the remote repository, you might need to use the '-u'
git pull origin main // Change in github, it take effect in local reprository. 'Synchronization'
git status
# Work on existing Project - Delete Some files and add new files | It is possible to rename reposiotry
1. Delete files manually using mouse keyboard
2. git add .
3. git commit -m "Deleted Files"
4. git push -u origin master
// Another way
1. git rm file1.txt file2.txt file3.txt // remove files and here not need to stage(git add)
2. git commit -m "Remove files: file1.txt, file2.txt, file3.txt"
3. git push -u origin master
# Branch Practice--- main(default)
git bracnh // show all branch and current branch in green; (for details) git branch -v / git branch -a
git branch orange // Create orange new branch; git checkout -b newBranch // create+Switch to newBranch
git checkout main // switch to main branch
git merge main // first go to master using git checkout master then run merge command;
it also brings all commit history
git branch -d orange // delete branch
# Remote(GitHub)
git add remote <UrlName> <URL-www.>
git remote -v // See URL; git remote aslo work but show only git name
git remote set-url secondURL https: //github.com/... // Change URL for second identifier
git push -u third master // you can push without switching branch, ie. from main branch you can push to other branch;
git push -f second main // Forch Push
git clone -b <branchName> <remote-repo-url> // Clone a Specic Branch from remote repo;
# Basic Windows command like cd
cd\ = back to root directory c drive does not metter where its current postion
cd .. = One step back
cd /d D: = C Drive to D drive
dir or ls(LS) = List all file and folder of current directory. "ls" is more clear to read
mkdir mynewfolder = Create New Folder
echo // Create file and put content Best* shor: echo > asdfwe.txt (Create file only no content)
touch
cd "folderName" = To enter Folder for doing some task
pwd //print working directory
clear = Clear Screen // "clear" in git bash